Markdown Table Generator
Turn CSV, spreadsheet cells or JSON into a Markdown table, or a table back into CSV.
About Markdown Table Generator
A Markdown table generator turns CSV, spreadsheet cells or a JSON array into a GitHub-flavoured Markdown table, and turns a table back into CSV.
How to use
- Paste CSV, cells copied from a spreadsheet, or a JSON array of objects. The format is detected; "Input format" overrides it.
- Untick "First row is the header" if the data has no column names.
- Pick the alignment (left, centre or right) and whether to pad the columns so the pipes line up.
- Copy the table or download it as
table.md. The preview underneath shows how it renders. - To go the other way, paste a Markdown table: the output becomes CSV, downloadable as
table.csv.
What it does
- Detection: text starting with
[or{is JSON; a first line containing a pipe followed by a delimiter row is a Markdown table; a tab in the first line means TSV, which is what spreadsheets put on the clipboard; anything else is CSV. - CSV and TSV are read by Papa Parse, so quoted fields, doubled quotes and line breaks inside a cell are handled, and comma, semicolon, tab and pipe delimiters are worked out automatically. Blank lines are skipped.
- JSON: an array of objects becomes one row per object, with a column for every key in the order first seen. Missing values are empty cells, and nested objects and arrays are written as JSON text. An array of arrays and a single object are also accepted.
- A pipe inside a cell is written as
\|and a line break as<br>. Cells are trimmed. Other Markdown in a cell, such as asterisks, backticks and links, is passed through and will render as Markdown. - The alignment applies to every column and sets the delimiter row to
:--,:-:or--:. Columns cannot be aligned individually. - Padding measures width as a monospaced font shows it: CJK and full-width characters and emoji count as two columns, combining marks as none. Emoji built from several joined parts can be a column or two out.
- Without a header row the columns are named "Column 1", "Column 2" and so on, because a GitHub-flavoured table must have a header. Short rows are filled with empty cells.
- Markdown to CSV: the outer pipes and the delimiter row are dropped,
\|becomes a pipe,<br>becomes a line break, and lines without a pipe are ignored. Alignment is not carried over. - The preview renders the first 200 rows. Links in it are not clickable.
- It does not merge cells, produce HTML tables, or convert a Markdown table to JSON.
Example
name,role,note
Ada,Engineer,"analyst | writer"
Grace,Admiral,
| name | role | note |
| :---- | :------- | :---------------- |
| Ada | Engineer | analyst \| writer |
| Grace | Admiral | |
Privacy
The conversion runs in the browser. No request is made with the data, and nothing is stored.
Frequently asked questions
- How do I convert an Excel or Google Sheets table to Markdown?
- Select the cells in the spreadsheet, copy them and paste them here. Spreadsheets put a tab between cells on the clipboard, which is detected as TSV and turned into a Markdown table with the first row as the header.
- How do I put a pipe character inside a Markdown table cell?
- Escape it with a backslash: \|. GitHub-flavoured Markdown then shows a plain | and does not start a new cell. This generator escapes pipes in the data for you.
- How do I align columns in a Markdown table?
- With colons in the delimiter row under the header: :-- aligns a column left, :-: centres it and --: aligns it right. Any number of hyphens works; the colons decide.
- Can a Markdown table cell contain a line break?
- Not a real one, because a line break ends the row. Write <br> where the break should be; GitHub and most Markdown renderers that allow inline HTML show it as a new line within the cell.