Markdown Table Generator

Convert CSV, TSV, or a JSON array of objects into a properly aligned Markdown table. GitHub Flavored Markdown compatible. Auto-detects numeric columns for right-alignment. Live preview included.

Text Tools
Ad
Input data
Markdown table
Preview (rendered)

What this tool does

Paste tabular data — CSV, TSV, or a JSON array of objects — and get a properly aligned Markdown table that renders correctly in GitHub READMEs, GitLab descriptions, Bitbucket pages, Hashnode posts, Dev.to articles, Notion, Obsidian, VS Code Markdown preview, and any other CommonMark-aware processor. The output is padded so the source aligns visually as well as the rendered output.

Markdown tables are not part of the original Markdown spec — they're an extension that GitHub Flavored Markdown (GFM) popularized. Almost every modern Markdown processor supports them now, but the syntax is finicky: cell separators are pipes (|), the second row defines column alignment with colons in the dashes, and rows can't span multiple lines. Hand-writing a wide table is tedious and error-prone. Generating from CSV or JSON is faster and more accurate.

Input formats

  • CSV — comma-separated. First row is the header. Cells with commas or quotes inside get wrapped in double quotes (standard CSV escaping). Multi-line cells aren't supported in Markdown tables, so the parser collapses any embedded line breaks to spaces.
  • TSV — tab-separated. Useful when you copy-paste from a spreadsheet (Excel, Google Sheets, Numbers all default to TSV when you copy a range). The same rules apply.
  • JSON — must be an array of objects. The columns are inferred from the union of all keys across all objects; missing fields render as empty cells. A non-array root or an array of primitives is rejected with an error.
  • Auto-detect — checks the first character. [ or { means JSON; presence of tabs means TSV; otherwise CSV.

Alignment options

Markdown table alignment is set per-column by the dashes-and-colons row: :--- left, :---: center, ---: right, --- default (typically left). This tool offers four modes:

  • Auto (default) — checks every value in each column; if all are numeric, right-align (matches how spreadsheets render numbers); otherwise default-align.
  • All left / center / right — forces a single alignment across all columns regardless of content.

Padding (visual alignment in source)

The default mode pads each cell with spaces so the source Markdown lines up visually. This makes the raw file readable and makes diffs sensible. The trade-off is that the source file is slightly larger than strictly necessary. Compact mode strips all padding — cells contain only their value plus the surrounding pipes — which is what most automated processes prefer.

Padded:
| Name    | Role     | Joined     |
| ------- | -------- | ---------- |
| Alice   | Engineer | 2023-05-01 |
| Bob     | Designer | 2024-01-12 |

Compact:
| Name | Role | Joined |
| --- | --- | --- |
| Alice | Engineer | 2023-05-01 |
| Bob | Designer | 2024-01-12 |

Markdown table syntax — the gotchas

  • Pipes inside cells need to be escaped as \| or replaced with |. The tool handles this automatically.
  • Line breaks inside cells are not supported by most parsers. Use <br> tags as a workaround when you really need a multi-line cell. The tool replaces actual newlines with spaces by default.
  • The alignment row is required. Without the second row of dashes, most parsers won't render the block as a table — they'll render it as raw text with pipes.
  • Column count must be consistent. Some parsers (GitHub) tolerate row-by-row variation; others (older CommonMark implementations) reject the whole table if any row has a different cell count.
  • Empty cells render as visually empty, but you still need to keep the pipes: | a | | c | has three columns with the middle one empty.

When to use Markdown tables vs alternatives

Markdown tables are great for small reference data — comparisons, glossaries, parameter lists. They're poor for anything more than ~6 columns wide (the source becomes unreadable) or anything with rich cell content (links + bold + code + line breaks). For larger data, embed an HTML <table> directly (most Markdown processors pass HTML through unchanged) or use a CSV/screenshot link. For genuinely tabular data that updates over time, generate it from a script as part of your README pipeline rather than hand-maintaining the Markdown.

Common use cases

Frequently asked questions

Which Markdown processors support tables?

GitHub Flavored Markdown, GitLab Flavored Markdown, Bitbucket Markdown, MultiMarkdown, CommonMark with the table extension, marked, markdown-it, remark with remark-gfm, Hashnode, Dev.to, Notion (with limitations), Obsidian, VS Code preview, and basically anything else that's been updated in the last decade.

How do I get a multi-line cell?

Markdown tables don't support multi-line cells natively. Use <code>&lt;br&gt;</code> as a workaround — most renderers honor it inside cells. For anything more complex, drop the Markdown table and use a raw HTML <code>&lt;table&gt;</code> element.

What if a cell contains a pipe (<code>|</code>)?

The tool escapes it as <code>\|</code>, which renderers correctly interpret as a literal pipe. You can also use the HTML entity <code>&amp;#124;</code> manually.

Why does the source table look misaligned when I paste it back?

Probably because the original was generated in padded mode (visual alignment) and re-pasting through a tool stripped the padding. Re-run through this generator to re-pad.

Is the JSON parser strict?

Yes. Must be a JSON array of objects. Non-array root, an array of primitives, or invalid JSON syntax all produce an error. If you have JSON5 / JSONC input, strip comments and trailing commas first.

Related tools