The smallest table that works
A Markdown table is three kinds of line: a header row, a separator row, and the data rows.
| Name | Role | Team |
| ---- | -------- | ---- |
| Ana | Designer | Web |
| Leo | Engineer | API |The separator row of hyphens is the important part. Without it, a renderer shows the lines as ordinary text with pipes in it.
Tables are not part of original Markdown or CommonMark. They come from GitHub Flavored Markdown (GFM), which most current tools support: GitHub, GitLab, VS Code's preview, Obsidian, Typora and most Markdown readers, including Aero Markdown. A strictly CommonMark renderer shows the source instead.
The rules renderers actually check
The GFM specification is short. In practice:
- A header row is required. There is no headerless table. If your data has none, write short column names.
- The separator row needs one cell per header cell. One hyphen per cell is enough; three or more is the convention and is easier to read.
- The outer pipes are optional.
Name | Roleworks, but leading and trailing pipes make rows easier to read and to edit. - Rows don't need to line up. The spaces that align columns in the source are only for people.
|a|b|renders the same as a padded row. - Short rows are padded and long rows are cut. A row with fewer cells than the header gets empty cells; extra cells are dropped.
- Each row is one line. A row cannot continue on the next line.
Align columns left, centre or right
Alignment lives in the separator row. A colon on the left, on both sides or on the right sets that column's alignment:
| Plan | Projects | Price |
| :------ | :------: | ----: |
| Free | 3 | $0 |
| Pro | No limit | $12 || Separator cell | Alignment |
|---|---|
--- | renderer default (usually left) |
:--- | left |
:---: | centre |
---: | right |
Right-aligning number columns makes figures easy to compare, and centring is useful for short values such as yes/no or ticks.
What can go inside a cell
Inline Markdown works in cells: bold, italic, inline code, links and images.
| Need | Write | Notes |
|---|---|---|
| A pipe character | \| | An unescaped pipe starts a new cell, even in inline code |
| A line break | <br> | Only where the renderer allows HTML, such as GitHub |
| An empty cell | nothing between the pipes | Every row still needs its pipes |
| Bold or a link | **Yes**, [docs](docs.md) | Inline formatting is fine |
| A list or code block | not possible | Use short text, or link to a section below |
| Merged cells | not possible | No colspan or rowspan in Markdown |
When a table needs paragraphs or lists inside cells, it is usually better as a list of headings, or as an HTML table where your renderer accepts HTML.
Convert Excel, Google Sheets or CSV to Markdown
Typing pipes for a twenty-row table is slow. Copy the data instead:
- Select the cells in Excel, Numbers or Google Sheets, header row included, and copy.
- Paste them into the Markdown table generator, under the grid, and choose Import into the grid.
- Set the alignment of each column, then choose Copy Markdown.
Spreadsheets copy as tab-separated text. The generator also reads comma-, semicolon- and pipe-separated text, including quoted CSV fields that contain commas, so you can paste a CSV export straight from a file. The first row becomes the header, as Markdown requires.
It works the other way too. To fix an existing table, paste the Markdown table into the same box: the generator reads its cells and alignment back into the grid.
Move a Markdown table back to a spreadsheet
To get a table out of a Markdown file or an AI answer and into Excel, convert it to tab-separated text. Paste the Markdown into the Remove Markdown tool and choose Copy plain text: each table row becomes a line with tabs between the values, and a spreadsheet puts each value in its own cell when you paste.
When a table looks wrong
- The whole table shows as text. The separator row is missing, has a different number of cells from the header, or the renderer doesn't support GFM tables. A blank line before the table also helps when it follows a paragraph.
- A row has a cell too many. An unescaped pipe in the content, often in a command such as
grep x | sort. Escape it as\|. - A row stops early. A line break in the middle of the row, often from pasting text that had one.
- The table is too wide to read. It is valid but has too many columns or long cells; see reading and exporting wide Markdown tables.
Frequently asked questions
How do you make a table in Markdown?
Write a header row with cells separated by pipes, then a separator row of hyphens, then one line per row: | Name | Role |, then | --- | --- |, then | Ana | Designer |. The separator row is what turns the lines into a table.
How do I align a column in a Markdown table?
Add colons to that column's cell in the separator row: :--- aligns left, :---: centres and ---: aligns right. Without colons, the renderer uses its default, usually left.
How do I put a pipe character inside a Markdown table cell?
Escape it with a backslash: \|. Without the backslash, the pipe starts a new cell and shifts the rest of the row.
Can a Markdown table cell contain a line break or a list?
Not in Markdown itself: each row must stay on one line. Renderers that allow HTML, such as GitHub, accept <br> for a line break inside a cell. Lists, code blocks and paragraphs can't go inside a cell.
Can I merge cells in a Markdown table?
No. Markdown tables have no colspan or rowspan. Repeat the value, leave the cell empty, or use an HTML table if your renderer accepts HTML.
How do I convert an Excel sheet to a Markdown table?
Copy the cells in Excel or Google Sheets and paste them into a Markdown table generator, such as the free one on aeromarkdown.app. Spreadsheets copy as tab-separated text, which the generator turns into a table with the first row as the header.