How to Convert JSON to a Markdown Table
Paste a JSON array of records to create a pipe table. Preview the result in the Markdown renderer used by your documentation platform. Table support is a Markdown extension rather than a feature of every Markdown dialect.
How JSON Keys Become Markdown Columns
Record keys become headers and records become rows. Sparse records leave empty cells. Keep column names concise so the source remains readable in a README or code review.
Escaping Pipes and Special Characters
Pipe characters inside data must be escaped so they do not start new columns. Newlines need flattening or an HTML break convention. Check backslashes and code spans in the destination renderer.
Nested JSON and Table Limits
Nested objects and arrays do not fit a flat table naturally. Serialize them in a cell or flatten the data first. For large or deeply nested payloads, a JSON code block can be clearer than a table.
Markdown Table Examples
An array containing name and score fields yields a two-column table with a separator row. Verify alignment and escaping after pasting into GitHub. Markdown output is documentation text rather than a lossless data-storage format.
More examples and technical details
GitHub Flavored Markdown Table Syntax
Tables are not part of the original Markdown specification. They come from GitHub Flavored Markdown, which is now the de facto standard and is implemented by essentially every modern Markdown renderer. The syntax has exactly three parts.
- A header row, with cells separated by pipe characters.
- A separator row directly beneath it, made of hyphens, with one group per column. This row is what tells the parser the block is a table at all.
- One or more data rows in the same pipe delimited form.
Leading and trailing pipes on each line are optional, though including them makes the table far easier to read in raw form and avoids ambiguity when a cell is empty. A blank line before and after the table is required, since without it the table can be absorbed into a neighbouring paragraph.
Side by Side Example
A release changelog rendered as a Markdown table.
JSON input
Markdown output
The pipe inside the first summary is escaped with a backslash. That single character is the difference between a working table and a mangled one.
Column Alignment
Colons placed in the separator row control how each column is aligned. This is the only formatting control the syntax offers, and it is worth using, because right aligned numbers are much easier to scan.
| Separator cell | Alignment | Use for |
|---|---|---|
| --- | Default, which renders as left | Anything unspecified |
| :--- | Explicit left | Text, names, descriptions |
| ---: | Right | Numbers, currency, counts, dates |
| :---: | Centre | Status ticks, short flags, icons |
Alignment in practice
The separator row must have the same number of cells as the header row. A mismatch is the second most common reason a table silently renders as a paragraph of pipes.
Escaping Pipes
The pipe is the cell delimiter, so a literal pipe inside cell content splits the cell in two and shifts every value after it. This is by far the most frequent breakage, and it is common precisely because pipes appear in real data: shell commands, regular expression alternations, union types, and the joined array values that other converters produce.
| Raw content | Written in the cell | Renders as |
|---|---|---|
| a | b | a \| b | a | b |
| cat file | grep x | cat file \| grep x | cat file | grep x |
| string | null | string \| null | string | null |
| `a | b` in code span | `a \| b` | Escaping is still needed inside backticks |
That last row surprises people. A code span does not protect a pipe inside a table cell, because the table is parsed into cells before inline code spans are processed. Escape it anyway. An alternative for content full of pipes is the HTML entity |, which most renderers pass through unharmed.
What Markdown Tables Cannot Do
A Markdown table cell holds inline content only. Bold, italic, links, images, and code spans all work. Block level content does not: no lists, no headings, no multiple paragraphs, no nested tables, no fenced code blocks.
The line break workaround
A break tag gives you multiple lines inside a cell on renderers that allow inline HTML, which covers GitHub, GitLab, and most static site generators. It does not work everywhere: renderers with HTML disabled for security will show the tag literally. There is also no way to merge cells, since Markdown has no equivalent of colspan or rowspan.
When a table genuinely needs block content, the answer is to write it as an HTML table inside the Markdown document. Most renderers pass raw HTML through, and you get the full expressive range at the cost of a much noisier source file.
Where These Tables Are Used
| Destination | Table support | Notes |
|---|---|---|
| GitHub README and issues | Full GFM | Alignment and inline HTML both work |
| GitLab and Gitea | Full GFM | Behaves the same as GitHub in practice |
| Notion | On paste | A pasted Markdown table becomes a native table block |
| Obsidian | Full | Live preview and a built-in table editor |
| Jekyll, Hugo, Astro, Docusaurus | Full | Styled by the site theme |
| Slack | None | Slack does not render Markdown tables, use a code block |
| Plain Markdown viewers | Varies | Tables are an extension, not core Markdown |
One last thing that puzzles newcomers: column widths in the source do not need to line up. The parser only cares about pipes and the separator row, so a table with ragged source columns renders identically to a beautifully aligned one. Many editors auto-format tables to align on save because it is much easier for a human to read and to diff, but it is purely cosmetic.
Documentation tables often start life somewhere else. See the full converter collection for JSON to HTML table when you need a styled web table, JSON to CSV when the same rows belong in a spreadsheet, and CSV to JSON when a colleague sends the data back the other way.
Standards and references
Frequently asked questions
How do I convert JSON to a Markdown table?
Paste a JSON record array and copy the generated Markdown table.
How are pipe characters escaped?
The converter escapes pipes so field contents do not create extra columns; verify them in your renderer.
Can nested objects be flattened?
Flatten the input first when you need nested properties as separate columns.
Will the output work on GitHub?
The pipe-table syntax is suitable for GitHub-flavored Markdown. Preview escaped cells before publishing.
Is conversion client-side?
Yes. Conversion runs in your browser.