Skip to content
ToolBoxGeniehome

Markdown Table Generator

Developer Tools · Added

Markdown tables are simple to read and tedious to type, and a single stray pipe breaks the alignment of everything after it. Fill in a grid or paste a range straight out of a spreadsheet, set the column alignment, and copy a table with the columns padded to line up and every pipe already escaped.

Where the data comes from

Up to 100 rows and 20 columns. The first row is the header unless you turn that off below.

Written into the separator row as :--- , :---: or ---: .

Result

Columns
3
Rows
2

excluding the header

Characters
115

Markdown

| Header | Header | Header |
| ------ | ------ | ------ |
| Cell   | Cell   | Cell   |
| Cell   | Cell   | Cell   |

How it renders

HeaderHeaderHeader
CellCellCell
CellCellCell

A pipe typed into a cell is escaped as \| on the way out, because an unescaped one ends the cell and silently shifts every column after it. A line break inside a cell becomes <br>, since Markdown table rows cannot span lines. Padding is cosmetic: it makes the raw table readable in a diff and changes nothing about how it renders.

How to use the markdown table generator

  1. 1Choose how to start: fill a grid cell by cell, or paste data you already have.
  2. 2For a paste, copy a range from a spreadsheet — it arrives tab-separated — or paste CSV, or paste an existing Markdown table to edit it.
  3. 3Set the alignment for each column: default, left, centre or right. This is written into the separator row.
  4. 4Use the checkboxes to turn the header row on or off, pad the cells so the source lines up, and add or remove the leading and trailing pipes.
  5. 5Copy the Markdown, or the HTML version, or download either as a file. The rendered preview underneath shows what the table will look like.

Examples

A spreadsheet range

Input
Three columns of data copied from a spreadsheet and pasted in
Result
A padded Markdown table with the first row as the header

Spreadsheets put tab-separated text on the clipboard, which the delimiter detection picks up without being told.

A cell containing a pipe

Input
A row with the cell: ls | wc -l
Result
| ls \| wc -l | Count files |

Without the backslash the pipe would end the cell, silently adding a column to that row and misaligning the table from there down.

A numeric column right-aligned

Input
Column 2 alignment set to Right
Result
That column's separator gains a trailing colon, and its cells are padded on the left instead of the right

Right alignment is worth setting on any column of figures — comparing numbers whose digits do not line up is needlessly hard work.

About the markdown table generator

Where hand-written Markdown tables go wrong

Three failures account for almost all of them. A pipe inside a cell ends that cell early, so one row gains a column and every column after it slides. A missing separator row means the block does not render as a table at all and appears as a paragraph full of pipes. And a row with fewer cells than the header simply drops its trailing columns, silently.

None of these produce an error message. Markdown has no validation step — a malformed table is just different text — so the failure surfaces when someone reads the rendered page, which is usually after it has been committed.

All three are structural rather than stylistic, which is exactly the kind of problem worth handing to a tool. The escaping happens on the way out, the separator is always written, and every row is squared off to the same width before anything is rendered.

Alignment markers, and when they earn their keep

The colons in the separator row are the only formatting control a Markdown table has: :--- for left, ---: for right, :---: for centred. They are worth using on exactly one kind of column — numbers. Figures compared down a column are far easier to read when their digits line up, and right alignment is what makes that happen.

For text columns the default is usually right, and adding markers is noise. The exception is a narrow column of short labels — yes/no, a status, a tick — where centring reads better than a ragged left edge.

Worth knowing: the markers control the rendered table, not the source. A right-aligned column still appears left-padded in the raw Markdown here, because that is what keeps the source columns lined up. What renders and what you read in the file are two different things, and both are worth having.

Frequently asked questions

Does the padding change how the table renders?
No. Extra spaces inside a cell are ignored by every Markdown renderer, so a padded table and a compact one produce identical output. Padding is entirely for the source: it makes the raw table readable in a text editor and, more usefully, makes a diff show only the cells that actually changed rather than reflowing the whole block. Turn it off when you want the shortest possible source.
What happens to a pipe character in my data?
It is escaped as a backslash followed by the pipe, which renders as a normal pipe and does not end the cell. This is the one piece of escaping a Markdown table genuinely needs and the one most hand-written tables get wrong, usually in a row containing a shell command or a set of options written as a | b.
Can a cell contain a line break?
Not literally — a Markdown table row must be one line, so a real newline would end the row. Any line break in your data is converted to a <br> tag, which most renderers including GitHub display as a break inside the cell. If you need more structure than that inside a cell, the HTML output on this page is the better starting point.
Can I edit a table I already have?
Yes. Paste it into the data box and choose the pipe delimiter, or leave detection on. The leading and trailing pipes are recognised and dropped rather than becoming empty columns, and the |---| separator row is discarded rather than treated as data. Change what you need and copy the result back out.
Why is a header row always written?
Because GitHub-flavoured Markdown requires one — a block with no header and separator does not render as a table at all. If your data has no header, turning the header option off writes an empty header row above your rows rather than promoting the first row into it, so the table still renders and no data is quietly relabelled.