Convert HTML Table to Markdown Online
Turn an HTML table into a Markdown pipe table, keeping only the text. The markup is read in your browser and never uploaded.
Drop a CSV or Excel file here
CSV · XLSX · XLS · XLSM · XLSB
Ready to download as a binary file.
How to convert an HTML table to Markdown
Three steps from links.html to a Markdown table.
1. Paste the HTML
Paste markup that contains a <table>, or drop an .html file.
2. Check it in the grid
Check rows that had colspan or rowspan: they come in with fewer cells, so values may sit one column off. Move them back in the grid.
3. Pick a style
Pretty (padded columns) or compact, column alignment, optional bold header, escaping; then copy or download data.md.
Example: HTML in, Markdown out
A resource list with links, an <em> tag and an underscore in the text.
<table>
<tr><th>Resource</th><th>Type</th><th>Notes</th></tr>
<tr><td><a href="https://developer.mozilla.org">MDN</a></td><td>Docs</td><td>Best <em>reference</em></td></tr>
<tr><td><a href="/guide">Style guide</a></td><td>Internal</td><td>Uses snake_case</td></tr>
</table>| Resource | Type | Notes |
| :---------- | :------- | :--------------- |
| MDN | Docs | Best reference |
| Style guide | Internal | Uses snake\_case |Links lose their URL: MDN arrives as plain text, and the <em> tag is dropped. snake_case is written as snake\_case. Add a link back in the grid as [MDN](https://developer.mozilla.org); brackets aren't escaped, so it survives.
What changes between HTML and Markdown
Pipe table
The output is a GitHub Flavored Markdown table. Pretty pads every column to the width of its longest value (3 columns here), so the source reads like a table too; Compact skips the padding and keeps diffs small.
Escaping
| is always escaped as \|, and with Escape special chars ticked so are *, _ and `. Here the value Uses snake_case is written as Uses snake\_case. It renders as the original text; untick the option if the cells contain Markdown you want rendered.
Text content only
Each cell's text is taken, trimmed. Tags inside cells (<a> and <em> here) are dropped and entities are decoded.
When to convert HTML to Markdown
- Moving a table from a web page or an old CMS into Markdown docs.
- Pasting a table from a site into a GitHub issue or README.
HTML to Markdown in JavaScript
TabularJS reads HTML: every <table> becomes a worksheet. Then each row is joined with pipes.
import tabularjs from 'tabularjs';
// The first row of the table becomes the column titles
const { worksheets } = await tabularjs('links.html', { tableIndex: 0 });
const header = worksheets[0].columns.map((col) => col.title);
const rows = worksheets[0].data;
const cell = (v) => String(v ?? '').replace(/\|/g, '\\|').replace(/\n/g, '<br>');
const line = (cells) => '| ' + cells.map(cell).join(' | ') + ' |';
console.log([line(header), line(header.map(() => '---')),
...rows.map((row) => line(header.map((_, i) => row[i])))].join('\n'));TabularJS differs from this page in two ways: it returns every <table> as a worksheet, and it turns colspan into mergeCells.
Frequently asked questions
How do I get the HTML of a table on a website?
Right-click the table, choose Inspect, then right-click the <table> element and pick Copy > Copy outerHTML. Paste that into the box.
What happens to <br> inside a cell?
It disappears without leaving a space, because only text content is read: "line one<br>line two" arrives as "line oneline two". Fix such cells in the grid.
Can I paste a whole web page?
Yes. The page looks for the first <table> in what you paste and ignores everything else. For a specific table, copy just that element (Inspect > Copy > Copy outerHTML).
What happens to empty cells?
They stay empty and keep their pipes, as in | a | | c |, so the columns don't shift.
Does links.html get uploaded when I convert it to Markdown?
No. The markup is read in your browser and never uploaded.