How to Convert JSON to Markdown Table for Tech Docs
Learn how to convert JSON to Markdown table format for READMEs and API docs, with per column alignment and real examples. Try the free converter today.
How to Convert JSON to Markdown Table for Technical Docs
If you need to convert JSON to Markdown table format, you almost certainly have an array of objects in hand and a README or API doc that needs to show it as a readable table. Markdown has no native support for JSON, so the array has to become pipe-separated rows before it displays as anything other than a code block. Here's how to do that by hand, how to do it with a converter, and how to handle the cases that break naive conversions.
The task sounds trivial until you hit the details. Column alignment, missing keys, nested objects, and values containing pipe characters all turn a two-minute job into a debugging session.
What Happens When You Convert JSON to Markdown Table Format
A Markdown table needs three things: a header row, a separator row of dashes, and one row per record. A JSON array of objects already maps onto that structure cleanly, because each object is a row and each key is a column.
Take this API response:
[
{ "id": 1, "name": "Widget", "price": 9.99, "in_stock": true },
{ "id": 2, "name": "Gadget", "price": 24.50, "in_stock": false },
{ "id": 3, "name": "Doohickey", "price": 3.75, "in_stock": true }
]
The equivalent Markdown table looks like this:
| id | name | price | in_stock |
|----|------|-------|----------|
| 1 | Widget | 9.99 | true |
| 2 | Gadget | 24.50 | false |
| 3 | Doohickey | 3.75 | true |
That renders as a proper table in GitHub, GitLab, Obsidian, MkDocs, and most static site generators.
Notice what the conversion actually did. It read the keys from the objects to build the header, then walked each object in order and pulled values by key. That is the whole algorithm when the data is well behaved.
How to Convert JSON to Markdown Table With Correct Alignment
The separator row does more than separate. It controls column alignment, and most people leave it as plain dashes without realizing they are giving up formatting control.
Three alignment options exist, set by where you place a colon:
| Left | Center | Right |
|:-----|:------:|------:|
| text | text | 42 |
A colon on the left aligns left, colons on both sides center, and a colon on the right aligns right.
Alignment matters more than it sounds for technical docs. Numeric columns read badly when left aligned, because the digits do not line up and comparing values takes real effort. Right aligning a price or count column makes the decimal points stack:
| Product | Price |
|:--------|------:|
| Widget | 9.99 |
| Gadget | 24.50 |
| Doohickey | 3.75 |
When you convert JSON to Markdown table output at scale, set alignment per column rather than accepting one default for the whole table. Text columns left, numbers right, short status flags centered.
Converting a Markdown Table From API Response JSON
Building a markdown table from api response json introduces problems that a hand-written example never shows you, because real API data is messier than a tutorial snippet.
Inconsistent keys cause the most common issue. Not every object in an array necessarily has the same fields:
[
{ "id": 1, "name": "Widget", "discount": 0.15 },
{ "id": 2, "name": "Gadget" },
{ "id": 3, "name": "Doohickey", "discount": 0.05 }
]
The second object has no discount key. A conversion that reads keys only from the first object produces a table with a discount column and a broken second row. The correct approach collects the union of all keys across every object, then fills missing values with an empty cell.
Pipe characters inside values cause a second problem. A product name like Widget | Large will split into two cells and shift every column after it. Escape any pipe in a value as \| before writing the row.
Nested objects create a third complication. Markdown tables are flat, so a value like { "warehouse": "east", "shelf": 12 } has no natural cell representation. You either flatten it into separate columns, location.warehouse and location.shelf, or serialize it back to a compact JSON string inside the cell.
Before converting anything, it helps to pretty-print the raw response so you can actually see the shape you are working with. The JSON Formatter validates the structure and catches a malformed payload before you waste time debugging the table output instead of the data.
Using a JSON to Markdown Table Generator Online
Writing the conversion by hand works for a five-row example. It stops being reasonable once you have forty rows pulled from a live endpoint, and it stops being reliable the moment the data contains an edge case you did not anticipate.
A json to markdown table generator online handles the key union, the pipe escaping, and the alignment in one pass. Paste the array, pick your alignment, copy the result into your doc.
The JSON to Markdown Table converter does exactly this. It reads the array, detects headers automatically across all objects rather than just the first, applies per column alignment, and outputs a table ready to paste.
Everything runs in your browser. If you want to confirm that, open DevTools, switch to the Network tab, paste your JSON, and run the conversion. No request appears. The data never leaves your machine, which matters when the API response you are documenting contains internal identifiers, customer records, or anything else you would not paste into an unknown server.
Converting a JSON Array to Markdown Table for a README
The most frequent real use of this conversion is a json array to markdown table readme block. Configuration options, environment variables, supported formats, CLI flags, all of it lives more comfortably as a table than as a bulleted list.
Say your config schema exists as JSON already:
[
{ "option": "timeout", "type": "number", "default": "30", "required": "no" },
{ "option": "api_key", "type": "string", "default": "-", "required": "yes" },
{ "option": "retries", "type": "number", "default": "3", "required": "no" },
{ "option": "verbose", "type": "boolean", "default": "false", "required": "no" }
]
Converted with the option column left aligned and required centered:
| option | type | default | required |
|:-------|:-----|:--------|:--------:|
| timeout | number | 30 | no |
| api_key | string | - | yes |
| retries | number | 3 | no |
| verbose | boolean | false | no |
The advantage of generating this from JSON rather than typing it is that the JSON stays the source of truth. When a new config option ships, you update the array and regenerate the table rather than hand editing pipes and hoping you did not miss a column.
For docs that reference encoded values, a token or a sample payload, the Base64 Encoder Decoder is useful for producing the encoded strings that go in those cells.
Choosing the Best JSON to Markdown Table Converter
Not every converter handles the same cases, so the best json to markdown table converter for your situation depends on what your data actually looks like.
A few behaviors are worth checking before trusting one with real data.
Key coverage matters first. Does it collect keys from every object, or only the first? Test with an array where the second object has an extra field. A converter that only reads the first object will silently drop that column.
Pipe handling matters just as much. Feed it a string containing a pipe character and see whether the row survives or splits.
Alignment control separates a real tool from a basic one. A single global alignment setting is not enough for a table mixing text and numbers, so per column control is worth confirming.
Where the processing happens is the last thing to check. For any payload containing real data, a client side converter that runs locally avoids the question of where your data went entirely.
If your JSON needs cleaning before conversion, extracting a subset of fields or stripping a prefix from every value, the Regex Tester is worth a stop first. Test the pattern against your actual data, confirm the matches, then apply it.
Converting JSON to Markdown Table Without the Manual Work
The mechanics of the conversion are simple enough to describe in a paragraph, but the edge cases are where hand written tables go wrong. Inconsistent keys drop columns. Unescaped pipes shift rows. Default alignment makes numeric data hard to scan.
When you convert JSON to Markdown table format for real documentation rather than a quick example, handling those cases matters more than the base conversion does. A generator that collects the full key union, escapes pipes, and gives you per column alignment turns a fiddly manual task into a paste and copy.
Try the JSON to Markdown Table converter on your next API response. Paste the array, set your alignment, and drop the result straight into your README or docs page.
Ready to try it yourself?
Browse Free Tools →