How do I turn tab-separated data into a Markdown table?
Short answer: The Markdown Table Generator turns tab-separated rows into pipe-style Markdown table text. Each line becomes a row, each tab starts a new column, and the separator row is always | --- |. With the header box checked, the first line is the header; every | inside a cell is escaped as \|. Click Copy Markdown and paste.
Key facts
- The Markdown Table Generator reads the "Tab-separated rows" box: every line is one table row and every tab character starts a new column.
- The "Use first row as header" checkbox is on by default; when it is off, the tool writes a header row of empty cells and keeps every input line as a body row.
- The separator row is always
---in each column, so there are no alignment colons and no padding to line up the columns. - The table is as wide as the longest input row, and shorter rows are filled up with empty cells.
- Each pipe character in a cell becomes
\|, while backslashes are left alone, so an already escaped\|comes out as\\|. - Cell text is not trimmed. Only completely empty lines at the end of the input are dropped, and a blank line in the middle becomes a row of empty cells.
- Conversion happens in the page's JavaScript with no network requests, and the Copy Markdown button uses the browser clipboard.
How to use
- Copy cells from a spreadsheet, or type your data with a Tab between columns, and paste it into "Tab-separated rows".
- Keep "Use first row as header" checked if line 1 holds column names. Uncheck it if line 1 is ordinary data.
- Click "Generate table". The Markdown appears in "Markdown output", and the status line reports the row and column counts.
- Click "Copy Markdown", paste it into your README, wiki or issue, and check the preview there.
Formula/logic
The generator is a string transformation, so there is no arithmetic. This is the logic it follows, step by step.
rows = input split on line breaks, then each line split on tab
rows = rows without trailing empty lines
width = largest number of cells in any row
cell = text (or empty if missing) with every | replaced by \|
line = "| " + cells joined with " | " + " |"
output = header line, separator line (--- x width), body lines
Nothing is rounded. The status message counts all rows, including the header row, so a header plus two data lines reads as a 3-row table.
Worked example
These inputs were run through the same logic as the tool. In the Input column, an arrow marks a Tab character.
| Input | Header box | Markdown output | Status |
|---|---|---|---|
Command→Meaning→ExampleOR→Pipe operator→a | bCopy→Clipboard→Ctrl+C | Checked | | Command | Meaning | Example || --- | --- | --- || OR | Pipe operator | a \| b || Copy | Clipboard | Ctrl+C | | 3-row, 3-column |
Plan→PriceFree→$0Pro→$12→annual | Unchecked | | | | || --- | --- | --- || Plan | Price | || Free | $0 | || Pro | $12 | annual | | 3-row, 3-column |
A→B(blank line) C→D | Checked | | A | B || --- | --- || | || C | D | | 3-row, 2-column |
Documenting a shell command that contains a pipe
Say you are writing a cheat sheet and one cell holds ps aux | grep node. In plain Markdown, that pipe would cut the cell in two. The generator rewrites it as ps aux \| grep node, which GitHub-style renderers show as a normal pipe.
Renderers differ in small ways, so look at the preview where the table will live.
Why everything landed in one column
The tool splits columns only on real tab characters. Commas, semicolons and runs of spaces do not count, so a pasted CSV line such as a,b,c becomes one cell.
Pressing Tab inside a browser text box usually jumps to the next field instead of typing a tab. Paste tab-separated text from a spreadsheet rather than typing it by hand.
Tables without a header
Pipe tables in GitHub-flavored Markdown need a header row above the separator. That is why unchecking the header box produces a row of empty cells instead of leaving the row out. If the destination needs real column names, add them as the first input line and keep the box checked.
Line breaks inside a cell
The tool does have a rule that turns a line break inside a cell into <br>. In practice, it never fires, because the input is split at line breaks before cells are processed. Each line break starts a new row. If your renderer allows HTML, type <br> into the cell yourself and the tool will keep it as written.
What this tool does not do
- The generator does not parse CSV, quoted fields or comma delimiters. Only tabs separate columns.
- The generator does not set column alignment, so there is no left, center or right option.
- The generator does not interpret or validate Markdown inside cells. Links, bold text and code spans pass through unchanged.
- The generator does not render a preview. You see plain Markdown source in "Markdown output".
Frequently asked questions
Can I paste a CSV file into the Markdown Table Generator?
No, it splits columns only on tab characters, not commas. A CSV line ends up as a single cell, so convert the commas to tabs first or paste from a spreadsheet.
What does the Use first row as header checkbox do?
It makes the first input line the table header. The box is checked by default, and every other line becomes a body row.
What happens when the header checkbox is unchecked?
The tool writes a header row of empty cells followed by the separator row, then keeps every input line as data. Markdown pipe tables need a header, and the tool does not invent column names.
How does the generator handle a pipe character inside a cell?
It replaces each pipe with a backslash and a pipe, so the character stays inside its cell. Backslashes are not touched, so an already escaped pipe gets a second backslash.
Can a cell contain a line break?
Not through the text box, because every line break starts a new row. If your renderer allows HTML, type the br tag into the cell yourself and the tool keeps it unchanged.
Why did all my data end up in one column?
The pasted text probably has spaces or commas instead of real tab characters. Only tabs split columns, so paste from a spreadsheet instead of typing separators.
Can I set column alignment in the generated table?
No, the separator row is always --- for every column. Add colons to the separator row by hand if you want left, center or right alignment.
Is the text I enter uploaded anywhere?
No, the conversion runs in your browser and the tool's script makes no network requests. The Copy Markdown button only writes to your clipboard.
Related tools
Last reviewed: