Free tool · Developer tools
Markdown table generator
Fill in a grid, or paste cells from a spreadsheet or a CSV file, and copy the Markdown table. Pick left, center or right for each column and check the preview before you paste it.
- Free
- No sign-up
- Runs in your browser
3 columns by 4 rows1 header row and 3 rows of data
- GitHub-flavoured Markdown
| Plan | Seats | Price per month |
|---|---|---|
| Starter | 1 | $9 |
| Team | 5 | $29 |
| Business | 25 | $99 |
- Columns
- 3
- Rows
- 4
- Lines
- 5
- Characters
- 195
How to use the Markdown Table Generator
- Type in the grid, or paste cells into Paste cells from a spreadsheet, or CSV text and press Put it in the grid.
- Use Add row, Add column, Remove last row and Remove last column to change the size.
- Pick Left, Center or Right in the box above each column. Untick First row is the header if your table has no header.
- Check the Preview, then press Copy or Download .md.
How do I make a table in Markdown?
A Markdown table has three parts. The first line is the header, with the column names between pipe signs. The second line is the divider, made of dashes. Every line after that is one row of data. The example grid gives 4 lines of data and a divider, and the first two lines read | Plan | Seats | Price per month | and | :------- | ----: | --------------: |.
The pipes at the two ends of each line are optional in some viewers, but writing them is safer. The spaces that line up the columns are only for people reading the raw text, because the viewer ignores them. With Line up the columns in the text ticked, the tool pads each cell. Untick it for the shortest text: the same table then starts | Plan | Seats | Price per month | and | :-- | --: | --: |.
Each row must stay on one line. A blank line ends the table, so a stray empty line in the middle splits it in two. According to the GitHub Flavored Markdown spec, the header row must have the same number of cells as the divider row, or the text is not read as a table. The tool always writes both rows with the same count, so that mistake cannot happen here.
How do I align the columns in a Markdown table?
Alignment is set in the divider line, with colons next to the dashes. A colon on the left means left, a colon on the right means right, and a colon on both sides means center. No colon leaves the choice to the viewer. Pick it in the box above each column and the tool writes the colons for you.
Numbers and prices usually read best on the right, so their digits line up. In the example grid, the Seats and Price columns are right-aligned and the Plan column is left-aligned, which is why the divider reads | :-- | --: | --: | when it is not padded.
| Alignment | Divider cell |
|---|---|
| Default (the viewer picks, usually left) | --- |
| Left | :-- |
| Center | :-: |
| Right | --: |
The divider needs at least one dash in the spec. This tool always writes at least three, which every viewer accepts and which leaves room for the colons.
How do I put a pipe or a new line inside a cell?
A pipe sign ends a cell, so a pipe that is part of your text must be escaped with a backslash. The spec says this works everywhere in a cell, even inside code. The tool does it for you: cat | dog is written as cat \| dog, and a chip tells you how many pipes were escaped.
A row cannot be split across lines, so a line break inside a cell is written with the HTML tag <br>. The text line one then a new line and line two becomes line one<br>line two. Whether the break shows depends on the site that displays your Markdown, because some strip HTML. Check the result where you will publish it.
Spaces at the start and end of a cell are removed, since the viewer would ignore them anyway. Text you type is never treated as HTML in the preview, so you see it exactly as typed.
How do I turn a spreadsheet or CSV into a Markdown table?
Copy the cells in your spreadsheet and paste them into the paste box. Cells copied from a spreadsheet are separated by tabs, and the tool reads them that way. A sheet with the header cells Name and Qty and two rows below it (Pen 3 and Ink 5) gives a table with 2 columns and 3 rows.
Plain CSV text works too, with commas, semicolons or pipes between values. A value in double quotes can hold the separator, a doubled quote for a quote mark, and even a line break. For example Tea,"hot, sweet" stays two cells, and "say ""hi""" becomes say "hi". The CSV above gives 3 rows in 2 columns.
The grid holds up to 100 rows and 20 columns. If your paste is bigger, the tool loads the first part and tells you how much was left out. After loading, you can still edit any cell and change the alignment. To convert a whole CSV file to JSON instead, use the CSV to JSON tool.
What if my table has no header row?
Markdown tables always have a header row, so a table of only data needs an empty one. Untick First row is the header and the tool adds an empty header line, then writes all your rows below the divider. For a 2 by 2 grid of numbers the text starts with | | | and the divider, and the table shows 3 lines, one more than the grid.
Rows that are shorter than the header are fine in the spec, because missing cells become empty cells, and extra cells in a row are ignored. The tool fills empty cells for you so the text stays tidy. The page runs in your browser and nothing you type or paste is sent anywhere.
Use it with
- JSON to CSV: convert JSON arrays to CSV.
- JSON to TypeScript: typeScript interfaces from a JSON sample.
- JSON Formatter: format and validate JSON.
Questions
How do I make a table in Markdown?
Write a header line with pipes, a divider line of dashes, then one line per row. The example grid starts | Plan | Seats | Price per month | and then a divider.
How do I align a column to the right?
Put a colon at the right end of the divider cell, as in --:. Pick Right above the column and the tool writes it.
How do I type a pipe inside a cell?
Escape it with a backslash. The text cat | dog is written as cat \| dog. The tool does this for you.
How do I add a line break inside a cell?
Write the HTML tag
. The tool converts each new line in a cell to
. Some sites strip HTML, so check where you publish.
Can I paste from Excel or Google Sheets?
Yes. Copy the cells and paste them into the paste box. Tab-separated cells, CSV, semicolon and pipe text are all read, and quoted values are handled.
Is my data uploaded anywhere?
No. The table is built by code in your browser. Nothing you type or paste is sent or stored.
The tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations are checked against the tool's own output.