Markdown Table Generator
Paste from a spreadsheet for tab-separated, or type comma-separated values.
- 3
- Columns
- 2
- Data rows
| Name | Role | Location | | :---- | :------- | :------- | | Amara | Engineer | Leeds | | Caleb | Designer | Bristol |
The Markdown table generator converts delimited data into a GitHub-flavoured Markdown table with the columns padded to line up in the source. It detects commas, tabs and pipes automatically, so pasting a range straight out of a spreadsheet works without changing any settings.
How it works
A Markdown table is a header row, a separator row that sets the alignment, and the data rows. The colons in the separator are what control alignment, and their position is the part that is easy to get backwards.
- :--- left-aligns the column. --- with no colons also left-aligns, since that is the default.
- :--: centres it. ---: right-aligns it.
- Column padding is cosmetic, renderers ignore it, but it is what makes the source readable and diffs meaningful.
- Pipe characters inside a cell are escaped as \| so they do not break the column structure.
Spreadsheet paste produces tab-separated text, which is why tab detection matters: a comma-separated parse of spreadsheet data would split cells that contain commas.
Examples
Comma-separated input with a header
Data
Name, Role, Location Amara, Engineer, Leeds Caleb, Designer, Bristol
First row
Is the header row
Result
| Name | Role | Location | | :---- | :------- | :------- | | Amara | Engineer | Leeds | | Caleb | Designer | Bristol |
Each column is padded to the width of its longest cell, so the pipes line up in the source. Three columns and two data rows.
Data with no header row
Data
1, 2, 3 4, 5, 6
First row
Is data: generate headers
Result
Headers become Column 1, Column 2 and Column 3, with both input rows kept as data
Markdown tables require a header row, so one is generated rather than promoting your first row of data into it.
Frequently asked questions
Which way round do the alignment colons go?
A colon marks the side the content sticks to. :--- is left, ---: is right, and :--: is centred. The mnemonic that works is that the colon is the wall the text leans against.
Why does the tool pad the columns if renderers ignore the spacing?
Because the source is read by people too. An aligned table can be scanned and edited in a plain editor, and a change to one cell produces a one-line diff rather than reflowing the row. It costs nothing at render time.
How do I include a pipe character inside a cell?
The tool escapes it for you as \|. Written unescaped, a pipe inside a cell is read as a column boundary and silently breaks the row structure.
Can I paste directly from Excel or Google Sheets?
Yes. Spreadsheet copy produces tab-separated text, which the automatic detection picks up. Leave the delimiter on automatic and it will not mistake a comma inside a cell for a column break.