How to Make a Markdown Table
A Markdown table is rows of cells separated by pipes, with a second line of dashes that separates the header and sets alignment. Colons in that line control alignment: left, right or centred. Pipes inside a cell must be escaped as \|, and a table cannot contain block content such as lists or paragraphs.
CSV to Markdown Table
Turn a spreadsheet export into a Markdown table.
Markdown tables are not part of the original specification. They come from GitHub Flavored Markdown and are now supported nearly everywhere, which means they work in most places but the edge cases vary between renderers.
Writing one by hand is fine for three rows and tedious beyond that. Generating from CSV is quicker for anything real, and it also handles the escaping you would otherwise have to remember.
Step by step
-
Write the header row
Separate each column with a pipe. Leading and trailing pipes are optional in most renderers but including them is clearer and safer.
-
Add the separator line
A row of dashes, one cell per column. This line is required — without it the renderer treats everything as ordinary paragraph text, which is the most common reason a table does not appear.
-
Set the alignment with colons
A colon on the left aligns left, on the right aligns right, and on both sides centres. Alignment is the only formatting control the table syntax offers.
-
Escape pipes inside cells
A literal pipe ends the cell, so write it as \|. This catches people out with code samples and anything containing a shell pipeline.
-
Handle content that will not fit
Cells cannot hold lists, paragraphs or headings. A line break inside a cell has to be written as <br>, which is the one piece of HTML a table row accepts. If you need more than that, use a list instead of a table.
-
Generate it from CSV for anything larger
Paste the data into a CSV to Markdown converter, which pads the columns so the source stays readable in a diff and escapes the pipes for you.
Example
Padding is cosmetic — renderers ignore it — but it keeps the source readable.
Markdown
| Tool | Runs | Free |
| :------ | :------- | ---: |
| Format | Browser | Yes |
| DNS | Server | Yes |
Renders as
Tool Runs Free
Format Browser Yes
DNS Server Yes
Column 3 is right-aligned;
columns 1 and 2 left.
Frequently asked questions
Why is my table not rendering?
Do the columns need to line up?
How do I put a line break in a cell?
Can a cell contain a list or a code block?
Are Markdown tables standard?
Tools used in this guide
All tools →- CSV to Markdown Table Turn a spreadsheet export into a Markdown table. In your browser
- Markdown to HTML Converter Convert Markdown into clean, safe HTML source. In your browser
- HTML to Text Converter Extract readable plain text from HTML, keeping the structure. In your browser
- CSV Sorter Sort CSV rows by one or more columns without a spreadsheet. In your browser
- CSV Column Extractor Keep only the columns you need from a CSV file. In your browser
Related guides
All guides →Last reviewed .