HTML Table to Markdown Converter
Quote a table from a page in an issue or a document. Spans are flattened into a real rectangle, pipes are escaped, and line breaks survive as br.
To convert an HTML table to Markdown, paste the markup above. Every table on the page is listed and the one you choose becomes a GitHub-flavored Markdown table: header cells become the header row, colspan and rowspan are resolved, pipes inside values are escaped, and numeric columns are right-aligned from the data.
Want to trim it to the useful columns? Open the app
Quoting a table in a place that only speaks Markdown
GitHub issues, most wikis, Slack canvases, documentation sites and every AI chat transcript take Markdown and not HTML. When the thing you need to quote is a table on a page, you either screenshot it, which nobody can search or copy from, or you retype it.
The screenshot is the common choice and it is the worse one. Six months later someone needs the numbers out of the issue and they are pixels.
Every table on the page, not the first one
A real page has more than one table in it. A Wikipedia article has an infobox before the table you want. A financial report has a summary above the detail. A saved dashboard has a legend rendered as a table.
Taking the first one is the default behaviour of nearly every converter on this term, and on a Wikipedia article it means you get the infobox. Here every table is found, labelled with its caption where it has one, listed with its row and column counts, and one click away.
A table nested inside another table's cell is treated as layout rather than data, which is what it almost always is in older markup. Its text stays in the cell that holds it and a note tells you how many were skipped.
Worked example
A page fragment with a merged label, which is the interesting case:
<table>
<tr><th>Region</th><th>Quarter</th><th>Revenue</th></tr>
<tr><td rowspan="2">North Coast</td><td>Q1</td><td>1840</td></tr>
<tr><td>Q2</td><td>2015</td></tr>
</table>
And the Markdown:
| Region | Quarter | Revenue |
| --- | --- | ---: |
| North Coast | Q1 | 1840 |
| North Coast | Q2 | 2015 |
The rowspan was filled down, so the second row says North Coast rather than being one cell short and shifting Q2 into the Region column. That shift is what a converter that ignores spans produces, and it is silent: the table looks plausible and every value is in the wrong place.
Colspan and rowspan, resolved rather than ignored
A cell with colspan="3" occupies three columns, and a converter that ignores that produces rows of different widths that then get padded in the wrong places. The value is repeated across the columns it covers, so the rectangle lines up.
A cell with rowspan="2" fills downward into the row below, which is how a merged category label in the first column is meant to read. rowspan="0" means "to the end of this section" and is handled, as is a rowspan that overshoots the last row, which is capped rather than used to invent empty rows.
This is the difference between reading a hand-built HTML table and reading one generated by a reporting tool. The generated ones are rectangles; the hand-built ones are full of spans, and they are the ones people need to convert.
Escaping, and what happens to markup inside a cell
A pipe in a value ends a Markdown cell, so every one is escaped as \|, with backslashes escaped first so a value ending in one cannot eat the escape after it.
A <br> in the source becomes a <br> in the Markdown, which GitHub renders as a line break inside the cell. That is the only way a Markdown table can hold a second line.
Other markup inside a cell is reduced to its text. A cell holding <strong>12</strong> gives you 12, and a cell holding an anchor gives you the link text rather than a Markdown link. Converting anchors into Markdown links is tempting and it is wrong more often than it is right, because most of them point at relative URLs that mean nothing outside the original page.
Frequently Asked Questions
Does it handle merged cells?
Yes, and this is the case that matters most here. A rowspan fills its value down and a colspan repeats it across, so the rows stay aligned. A converter that ignores spans produces a table that looks plausible with every value one column out.
Are pipes in my data escaped?
Every one, and backslashes are escaped first so a value ending in a backslash cannot consume the escape on the pipe that follows. An unescaped pipe is the usual reason a generated Markdown table renders broken.
What happens to a link inside a cell?
You get the link text, not a Markdown link. Most links in a page table are relative URLs that mean nothing once the table has moved somewhere else, so turning them into links would produce broken ones.
Is bold or emphasis inside a cell preserved?
No, the cell is reduced to its text. Inline formatting in a data table is presentation, and carrying it over means guessing which of several Markdown spellings you wanted.
Why is only one column right-aligned?
Because only one column is entirely numeric. Alignment follows the type decided from all the values, not the shape of the characters, so a padded code column stays left-aligned rather than being presented as a quantity.
The page has an infobox and the table I want. Which do I get?
Both are listed, with their captions and row counts, and you pick. Taking whichever table appears first in the markup is what most converters do, and on an article page that means the infobox.
Quote the table, do not screenshot it
Spans resolved, pipes escaped, line breaks kept. Copy and paste into the issue.
Back to the converter