JSON to Markdown table — GitHub-ready tables from JSON arrays

Paste a JSON array of objects and get a GitHub Flavored Markdown table back, with pipes escaped, line breaks turned into br tags and number columns right-aligned, ready for a README, wiki page or pull request.

Live demo · real result from this tool

Markdown table

| id | name | city | score | active || ---: | :--- | :--- | ---: | :--- || 1 | Asha | Pune | 92.5 | true || 2 | Ben | Leeds | 78 | false || 3 | Chen | Taipei | 85.25 | true | 

Processed on your device — nothing is uploaded.

How to use JSON to Markdown Table

  1. Paste an array of objects into JSON. A single object gives a one-row table.
  2. Choose Column alignment: Auto (numbers right), Left, Centre or Right.
  3. Copy the Markdown table, or press Download to save table.md.
  4. 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.city as 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?
A column is right-aligned when every value in it is a number, null or missing, and left-aligned otherwise. One string such as "7" in a column of numbers makes the whole column left-aligned. Pick Left, Centre or Right to force one alignment for every column.
Will the table render outside GitHub?
The pipe-and-dash syntax is the GitHub Flavored Markdown tables extension, which GitLab, many static site generators and editors such as VS Code and Obsidian also read. Cells with line breaks use a br tag, which only renders where the Markdown processor allows inline HTML.
Does it escape Markdown characters inside cells?
It escapes the pipe and the backslash, which would otherwise break the table. Other Markdown, such as *stars*, _underscores_ or backticks, is left as it is, so a value like _id_ may render in italics. Wrap such values in backticks by hand if they must appear literally.
Why are the columns not padded to line up in the source?
The output keeps one space around each cell, which is valid and keeps diffs small. Renderers line the columns up for you. If you want aligned source text, run it through a Markdown formatter such as Prettier.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close