MarkPrep

Markdown table generator

The Markdown table generator on this page turns what you type into a grid into a Markdown table, ready to copy. The first row of the grid becomes the table's header row.

Rows
3
Columns
3
Markdown
| Name | Role | Score |
| --- | --- | --- |
|  |  |  |
|  |  |  |

How the generator works

Markdown table syntax

A table in Markdown has three parts. The header row names the columns, the divider row of hyphens comes second, and each line after that is one data row. Pipes (|) separate the cells.

| Name | Role     | Score |
| ---- | -------- | ----- |
| Ana  | Editor   | 9     |
| Raj  | Reviewer | 7     |

The cells don't have to line up. The pipes at the start and end of each row are optional, so this shorter version gives the same table:

Name | Role | Score
--- | --- | ---
Ana | Editor | 9

Align columns

A colon on the left of the hyphens aligns the column left. Colons on both sides centre it, and a colon on the right aligns it right.

| Item   | Qty | Price |
| :----- | :-: | ----: |
| Pens   | 10  |  4.50 |
| Folder |  2  | 12.00 |

What a cell can hold

A cell can hold bold text, italics, inline code and links. If a row has fewer cells than the header, the missing cells are left empty.

Tables are part of GitHub-flavoured Markdown. The original Markdown syntax has no tables, so an app that uses only the original rules shows the pipes as plain text. For alignment, escaping pipes and the mistakes that break a table, see Markdown table syntax, explained.

Make a table from a spreadsheet

Typing works for a short table. For a long one, CSV to Markdown turns a .csv or .tsv file into a table, and Excel to Markdown makes one table per sheet. The Markdown cheat sheet has the rest of the syntax.

Frequently asked questions

How do I make a table in Markdown?+

Write a header row with the cells separated by pipes (|). Under it, add a divider row with three hyphens per column, then one line for each data row. The generator on this page writes all three for you and names any empty header cell, such as Column 1.

How do I align a column in a Markdown table?+

Add colons to the divider row. :--- aligns the column left, :---: centres it and ---: aligns it right. The generator writes plain --- dividers, so add the colons after you copy the table.

Can I convert text to a Markdown table?+

Yes. For a few rows, type or paste each value into a cell of the grid. For a whole CSV file or Excel workbook, the CSV to Markdown and Excel to Markdown converters make the table in one step.

How do I convert Markdown to a formatted table I can read?+

Paste it into the Markdown viewer or the Markdown editor. Both render the table with rows and columns as soon as you paste it.