JSON to markdown table converter
Updated
Paste a JSON array of objects, an object of objects, an object of arrays, or a single object and get a GitHub-flavored markdown table. Nested keys flatten to dot paths, arrays join with commas, null becomes an empty cell, and pipes are escaped. Reorder, hide and align columns, then copy or download. Flip the direction to turn a markdown table back into a JSON array. Everything runs in your browser.
array of objects · 3 rows × 7 columns · nested keys become a.b.c, arrays join with commas, null is an empty cell, pipes are escaped as \|. Nothing is uploaded.
How does each JSON shape map to a table?
A markdown table is a flat grid, so the converter first decides which part of the JSON is the list of rows and which part is the list of columns. These are the shapes it recognizes and what it does with each one.
| JSON shape | Example | Columns | Rows |
|---|---|---|---|
| Array of objects | [{"id":1,"name":"Ada"}, {"id":2}] | Union of every key, in first-seen order | One per object; missing keys are empty cells |
| Object of objects | {"ada":{"age":36}, "grace":{"age":85}} | A key column, then the inner keys | One per outer key |
| Object of arrays | {"name":["Ada","Grace"], "age":[36,85]} | One per outer key (column-major data) | One per index; shorter arrays pad with empty cells |
| Array of arrays | [[1,2],[3,4]] | column1, column2, … as wide as the longest row | One per inner array |
| Array of primitives | ["a","b","c"] | A single value column | One per element |
| Single object | {"name":"Ada","born":1815} | key and value | One per (flattened) key |
| Wrapped API response | {"data":[{"id":1},{"id":2}]} | As array of objects | A single wrapper key around an array of objects is unwrapped |
What are the flattening rules for nested values?
A table cell holds text, so every non-scalar value has to be turned into text. The rules below are applied to each value; the only setting that changes them is Flatten depth, which caps how many levels of nested objects become dot-path columns.
| Value in the JSON | Example | Cell in the table |
|---|---|---|
| Nested object | {"geo":{"lat":51.5}} | Flattened into a dot-path column geo.lat (up to the chosen depth); deeper levels are kept as compact JSON |
| Array of primitives | ["a","b"] | Joined with a comma and a space: a, b |
| Array of objects | [{"id":1}] | Kept as compact JSON text: [{"id":1}] |
| null | null | Empty cell |
| Missing key | (key absent in this object) | Empty cell |
| Boolean | true | The text true or false |
| Number | 1.5e3 | JavaScript's number text: 1500 |
| String with a pipe | "a | b" | The pipe is escaped as \| so it does not split the column |
| String with a newline | "line1\nline2" | The newline becomes <br>, because a table cell cannot span lines |
| Empty object | {} | The text {} |
The output is a standard GFM table: header row, a separator row of dashes with optional colons for alignment (:--- left, :---: center, ---: right), then one line per row. Syntax details are in the markdown table guide and on the cheat sheet.
How do I choose, order and align the columns?
Every flattened key appears as a chip above the input. Click a chip to cycle its alignment through left, center and right; click the × to hide that column (the data is untouched, it is just left out of the table). The Columns menu switches between the order the keys were first seen, alphabetical order, and a custom order you type as a comma-separated list of column names, with any unlisted columns following in their original order. Header rewrites the header cells only, so firstName or contact.city can be shown as First Name and Contact City while the data stays as it was.
When should I use this instead of the CSV converter or the table generator?
Use this page when the data is already JSON: an API response, a config file, a log export, or the output of a script. The CSV to markdown converter does the same job for comma- or tab-separated text and cells pasted from a spreadsheet; the markdown table generator is a grid editor for typing a table from scratch. All three produce the same GFM syntax, so a table made here can be re-padded later with the formatter or converted to HTML with the markdown to HTML converter.
Does the conversion lose information?
Some, by design: a table has no way to say whether 1 was a number or the string "1", whether a blank cell was null, an empty string, or a missing key, or where one array element ends and the next begins once they are joined with commas. The reverse direction makes the common-sense guess (numbers, booleans and null are inferred; dotted headers become nested objects), which round-trips typical records exactly. If the strings matter, turn inference off and every cell comes back as a string. Nothing leaves your browser in either direction.
How do I convert a JSON array of objects to a markdown table?
Paste the array into the JSON box. Each object becomes one row and the union of all keys becomes the header, in the order the keys first appear. Objects that are missing a key get an empty cell in that column. Copy the markdown or download it as a .md file.
What happens to nested objects and arrays in the JSON?
Nested objects are flattened into dot-path columns such as address.city, as many levels deep as the Flatten depth setting allows; anything deeper is kept as compact JSON text in the cell. Arrays of strings or numbers are joined with a comma and a space; arrays of objects stay as JSON text.
How are null, true, false and numbers written in the table?
null and missing keys become empty cells. Booleans are written as the words true and false, and numbers as their shortest JavaScript text, so 1.5e3 becomes 1500 and 1.0 becomes 1. The reverse direction turns those texts back into the same JSON types when "Infer numbers, booleans, null" is on.
Why does my JSON show an error with a line and column?
The input must be strict JSON: double-quoted keys and strings, no trailing commas, no comments, no NaN or undefined. The error names the first violation and where it is, for example a single-quoted string on line 3 or a trailing comma before a closing bracket. Fix that spot and the table appears immediately.
Can I turn a markdown table back into JSON?
Yes. Switch to Markdown → JSON, paste a table, and every body row becomes an object keyed by the header cells. Numbers, booleans and null are inferred unless you turn that off, and dotted headers like address.city are expanded back into nested objects.