How to use JSON to Markdown Table
- Paste an array of objects into JSON. A single object gives a one-row table.
- Choose Column alignment: Auto (numbers right), Left, Centre or Right.
- Copy the Markdown table, or press Download to save
table.md. - Paste it into your README, issue, pull request or docs page and preview it.
What it does and when to use it
Writing a Markdown table by hand means counting pipes and dashes and fixing them every time the data changes. If you already have the data as JSON, from an API, a test run or a benchmark script, this tool writes the table for you. Typical uses: an endpoint list in API docs, a results table in a pull request, a feature or config option matrix in a README, or a changelog of package versions.
To look at the same data as an on-screen grid or export it as CSV, use JSON to table. For tabular data that is already CSV, there is CSV to Markdown. To preview how the Markdown will look as HTML, paste it into Markdown to HTML.
How it works
The JSON is parsed in your browser. Columns are every key found in any object, in first-seen order; an object that lacks a key gets an empty cell. Each cell value is written as text: strings as they are, numbers and booleans as written, null as null, and nested objects or arrays as compact JSON.
Three characters are escaped so they cannot break a row: \ becomes \\, | becomes \| (as the GFM tables extension allows), and a line break becomes <br>. The delimiter row then uses :--- for left, ---: for right and :---: for centre.
Worked examples
Response-time figures with a missing value, using Auto alignment:
[{"endpoint":"/users","method":"GET","p95_ms":120},
{"endpoint":"/orders","method":"POST","p95_ms":340},
{"endpoint":"/health","method":"GET","p95_ms":null}]
| endpoint | method | p95_ms |
| :--- | :--- | ---: |
| /users | GET | 120 |
| /orders | POST | 340 |
| /health | GET | null |
The null does not stop p95_ms from counting as a number column, so it is right-aligned.
A CLI flag with a pipe and a two-line description, alignment set to Left:
| --out \| -o | Output file<br>required |
Limits and tips
- The table is one level deep. Flatten nested records with the JSON flattener first if you want
address.cityas its own column. - Every row is written; very long tables are better linked as a CSV file than pasted into a README.
- Header cells are the raw key names. Rename keys in the JSON before converting if you want friendlier headings.
Frequently asked questions
How does Auto alignment decide?
Will the table render outside GitHub?
Does it escape Markdown characters inside cells?
Why are the columns not padded to line up in the source?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.