JSON to Markdown Converter
Paste JSON or upload a .json file. Arrays of flat objects become tables; nested objects become headings and lists.
Markdown output will appear here...
To convert JSON to Markdown, paste the JSON (or upload a .json file) into the box above and copy the Markdown on the right. Arrays of flat objects become tables with one column per key. Objects become ## headings, plain values become - **key**: value lines, and arrays of strings or numbers become bullet lists.
What does the output look like?
An array of flat objects becomes a table
[
{ "id": 1, "name": "Ana", "active": true },
{ "id": 2, "name": "Li", "active": false, "team": "ops" }
]| id | name | active | team |
| --- | --- | --- | --- |
| 1 | Ana | true | |
| 2 | Li | false | ops |A nested object becomes headings and a list
{
"service": "billing",
"owner": { "name": "Dana", "slack": "#billing" },
"regions": ["eu-west-1", "us-east-1"]
}- **service**: billing
## owner
- **name**: Dana
- **slack**: #billing
## regions
- eu-west-1
- us-east-1One nested value turns the table into sections
{
"users": [
{ "name": "Ana", "tags": ["admin", "ops"] },
{ "name": "Li", "tags": [] }
]
}## users
- **name**: Ana
### tags
- admin
- ops
- **name**: Li
### tags
Because each user has a tags array, the users are written one after another as lists instead of a table.
When does a JSON array become a Markdown table?
Only when every item is an object and every value in those objects is a string, number, boolean or null. The columns are every key seen across all items, in the order they first appear. An item that lacks a key gets an empty cell, as with team in the first example.
If any item holds a nested object or array, the whole array is written as lists instead. To get a table anyway, flatten the data first, or paste the rows as CSV into CSV to Markdown.
How are nested objects converted?
Each key that holds an object or array becomes a heading, starting at ## for the top level and going one level deeper per step. Headings stop at ######, the deepest Markdown allows, so anything nested more than five levels down shares that level.
What if my JSON is invalid?
The converter uses the browser's strict JSON parser, so trailing commas, single quotes, comments and unquoted keys all fail. The parser's error message is shown beside the output and nothing is converted until the input parses. JavaScript object literals copied from code usually need those fixes.
Can I convert JSON to Markdown on the command line?
Pandoc will not do it: pandoc -f json reads Pandoc's own document format, not arbitrary JSON. The usual tool is jq, where you write the table yourself:
jq -r '.[] | "| \(.id) | \(.name) |"' users.json
That is the right approach for a script or many files. For a one-off payload, pasting it here is faster. If the data is YAML rather than JSON, use YAML to Markdown.
How are nulls, big numbers, pipes and other edge cases handled?
| Input | What you get |
|---|---|
| Pipe | in a table value | Escaped as \| |
| Pipe | in a key used as a column name | Not escaped, so the header gets an extra column. Rename the key |
| Line break (\n) in a table value | Written as a real line break, which splits the table row |
| null, or missing key, in a table | Empty cell |
| null as an object value | A heading with the key and nothing under it |
| Empty object {} or array [] | A heading with nothing under it |
| true / false / numbers | Written as text: true, false, 42 |
| Integers above 9007199254740991 | Rounded by JavaScript: 12345678901234567890 becomes 12345678901234567000. Quote big IDs as strings |
| Array of arrays [[1,2],[3,4]] | Flattened into one bullet list: 1, 2, 3, 4 |
| A bare string or number | Output as that value on its own |
| Accents, CJK and emoji | Passed through unchanged |
| Wide arrays of objects | One column per distinct key, however many there are |
How does this compare with jq and Pandoc?
| MDConvert (this page) | jq | Pandoc | |
|---|---|---|---|
| Reads any JSON | Yes | Yes | No, -f json means Pandoc's own AST |
| Builds tables for you | Yes, for arrays of flat objects | No, you write the row template | Not applicable |
| Install needed | No, runs in the browser | Yes, command-line program | Yes, command-line program |
| Batch / scripting | No, one document at a time | Yes | Yes |
| Your data leaves your machine | No | No | No |
jq gives full control over the output and is the better choice inside a pipeline. This page is for getting readable Markdown from a payload without writing a filter.
Maintained by Ankit Aglawe. Last updated .
Related Tools
Need a different format? See every tool on the Markdown converter page, or go back to the MDConvert home page.