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.
Result
- Columns
- 3
- Rows
- 2
- Characters
- 115
excluding the header
Markdown
| Header | Header | Header | | ------ | ------ | ------ | | Cell | Cell | Cell | | Cell | Cell | Cell |
How it renders
| Header | Header | Header |
|---|---|---|
| Cell | Cell | Cell |
| Cell | Cell | Cell |
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
- 1Choose how to start: fill a grid cell by cell, or paste data you already have.
- 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.
- 3Set the alignment for each column: default, left, centre or right. This is written into the separator row.
- 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.
- 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?
What happens to a pipe character in my data?
Can a cell contain a line break?
Can I edit a table I already have?
Why is a header row always written?
Related tools
Markdown to HTML Converter
Text Tools
Convert Markdown to clean HTML, or HTML back to Markdown, with a live preview.
CSV to JSON Converter
Developer Tools
Convert CSV to JSON or JSON back to CSV, with proper quoted-field handling.
Text Sorter
Text Tools
Sort lines alphabetically, numerically, by length or randomly, ascending or descending.