Skip to main content
CalcChef

Markdown Table Generator

Type cells in a grid or paste from a spreadsheet to get a padded Markdown pipe table with left, center or right alignment, plus HTML and CSV copies. How it works

Use the Markdown Table Generator

Row and column tools act on row 1, column 1: click a cell to pick another.

Cells are padded to the widest cell of their column (counted in characters; wide characters such as CJK or emoji may not line up), pipes are written as \| and line breaks as <br>. Up to 50 rows and 20 columns.

About the Markdown Table Generator

A Markdown table is a header row, a delimiter row of hyphens and the body rows, with cells between pipes. The Markdown table generator writes one from a grid you type in or paste, pads each cell to the widest in its column so the source lines up, and sets left, center or right alignment with :--, :-: or --: in the delimiter row.

The starting table with Role centered and City right-aligned

LineMarkdown
Header row| Name | Role | City |
Delimiter row| :---- | :------: | -------: |
Row 2| Ada | Engineer | London |
Row 3| Grace | Admiral | New York |

Copy Compact gives the same table without padding: | Name | Role | City |, then | :-- | :-: | --: |.

Characters that are escaped

In the cellIn the Markdown
a|ba\|b
a\|ba\\\|b
line1 ⏎ line2line1<br>line2

⏎ is a line break typed in the cell. Backslashes already in front of a pipe are doubled, so a renderer reads the cell back as typed.

Frequently asked questions

How do I align a column in a Markdown table?
Put colons in the delimiter row: :-- for left, :-: for center, --: for right (GitHub Flavored Markdown). In the generator, click the button above a column; it cycles Left, Center and Right, and the delimiter row changes to match.
How do I put a pipe character inside a table cell?
Escape it with a backslash, as GFM requires. The generator does it for you: a|b is written a\|b. A line break inside a cell becomes <br>.
Can I convert a spreadsheet or CSV to a Markdown table?
Yes. Copy cells from a spreadsheet and press Paste from Spreadsheet; the browser may ask for permission to read the clipboard. If it refuses, paste tab-separated, comma-separated or Markdown table text into the box and press Import pasted text. Quoted CSV cells keep their commas, so "x, y",2 gives the cells x, y and 2. Up to 50 rows and 20 columns are imported; the rest is cut with a note.
Do the columns have to line up?
No. GFM says cells in a column do not need to match in length; padding only makes the source easier to read. Copy Compact gives the table without padding.
Why does the CSV copy put a quote mark before some cells?
Only when you tick the CSV option: cells that start with =, + or @, or with - followed by a letter, a bracket or one of = + - @, get a leading ' so a spreadsheet shows them as text, so =SUM(A1:A3) is written '=SUM(A1:A3). It is off by default because it changes the data.

Related Tools

View all tools