OnlineTextLab
Esc

Markdown Table Generator

Turn pasted rows into a Markdown table, realign a messy one, or start from an empty grid.

Column alignment
Layout
Blank table

Markdown table

The table appears here with a rendered preview, or start from a blank table.

Runs on your device. Your files and text are not uploaded.

About Markdown Table Generator

Writing a Markdown table by hand is tedious, and keeping its columns tidy after one edit is worse. Copy cells from a spreadsheet and paste them here, or paste CSV, and you get a table with every column padded to the same width, plus a preview of how it will render.

The same box handles the other two jobs people have. Paste a table that has drifted out of line and it comes back straight, with its alignment markers kept. Or set a number of rows and columns and insert an empty table, ready for you to fill in a README or pull request description.

How it works

The tool first checks whether the second line is a Markdown divider. If so, it reads the text as an existing table. If not, it treats it as delimited data and picks the separator by looking at your first lines: tabs win outright, since that is what a spreadsheet copy gives you, and otherwise commas, semicolons or pipes, preferring whichever splits the lines consistently.

Quoted fields follow CSV rules, so "Projects, active" stays one cell. Pipes inside cells are escaped as \|, since a bare one would end the cell. Line breaks inside a quoted field become <br>, the only way to get a second line in a Markdown cell. A row that comes up short gets empty cells, so the table stays rectangular. A quote that never closes stops the run with a message giving its line, rather than quietly merging the rows below it.

How to use Markdown Table Generator

  1. Paste rows into the Rows, or an existing Markdown table box, or press Upload. Try an example shows quoting and an escaped pipe.
  2. Choose a Column alignment, or leave it on Default. Numbers right right-aligns any column holding only numbers, and an existing table keeps its markers unless you pick one.
  3. Change Layout to Compact if you would rather have no padding in the source.
  4. Tick First row is data, not a header if your first line is not a header. The tool then adds Column 1, Column 2 and so on.
  5. For an empty table, set Columns and Rows and press Insert blank table.
  6. Check the rendered preview, then press Copy, or Download to save table.md.

CSV with a comma and a pipe inside cells

Input
Feature,Free,Pro
"Projects, active",3,Unlimited
Storage,1 GB,100 GB
Support,Community,"Email | chat"
Output
| Feature          | Free      | Pro           |
| ---------------- | --------- | ------------- |
| Projects, active | 3         | Unlimited     |
| Storage          | 1 GB      | 100 GB        |
| Support          | Community | Email \| chat |

The comma stays inside its quoted cell, and the pipe is escaped so it displays as a pipe. The padding is only for reading the source, and the table renders the same without it.

When it helps

  • Moving a small table from a spreadsheet into a README
  • Straightening a table in documentation after someone edited one row
  • Adding a comparison table to a pull request or an issue
  • Laying out an empty grid to fill in by hand while writing notes

Tips for a better result

  • Copying directly from a spreadsheet works best. Cells arrive separated by tabs, so commas inside them cause no trouble.
  • Right-align columns of numbers. Digits then line up, and it is much easier to compare sizes by eye.
  • To go the other way, Markdown Table to CSV turns a table back into a spreadsheet file.

Good to know

  • Left, Center and Right apply to every column. For a mix, edit the divider row afterwards or paste a table that already has the markers you want.
  • Padding counts characters, so wide characters such as emoji and Chinese can leave the source slightly out of line in some editors, though it renders correctly.
  • Tables are a GitHub Flavored Markdown extension. Some basic Markdown renderers will show them as plain text.
  • Markdown tables cannot merge cells, and multi-line cells depend on the renderer accepting <br>.

Questions people ask

Do Markdown tables need to line up?

No. Renderers only care about the pipes and the divider row. Lining up the columns is purely for people reading the source, and it costs you bigger diffs when a width changes.

How do I put a pipe character in a cell?

Write it as \|. This tool does that for you, and it reads existing escapes correctly when realigning a table.

How do I set alignment by hand?

In the divider row, a colon on the left means left, on the right means right, and on both sides means center. For example, :---: centers a column.

My data has semicolons. Will that work?

Yes. Semicolons are common in CSV exports from European spreadsheets, and they are detected along with commas, pipes and tabs.

What to use next

Last reviewed . Read our editorial policy.