HTML Table to Markdown Converter
Paste HTML on the left, get a clean GitHub-flavoured Markdown table on the right. Nothing is uploaded — the conversion runs entirely in your browser.
How do you convert an HTML table to Markdown?
Paste the table's HTML into a converter and it rewrites each <tr> as a pipe-delimited Markdown row, promotes the first row to headers, and inserts a --- separator line beneath it. Cell text is kept, tags are stripped, and literal pipe characters are escaped so the column structure survives.
<!-- HTML input -->
<table>
<tr><th>Name</th><th>Age</th></tr>
<tr><td>John</td><td>25</td></tr>
</table>
<!-- Markdown output -->
| Name | Age |
| --- | --- |
| John | 25 |The header cells become the first Markdown line, the dashed row defines the columns, and every remaining <tr> becomes one pipe-delimited data row.
Try the HTML Table to Markdown Converter
HTML Input
Markdown Output
Preview
How HTML tables map to Markdown
Markdown tables are far simpler than HTML tables: one line per row, pipes between cells, and a single dashed row that declares the columns. Most conversions are lossless, but a few HTML features have no Markdown equivalent — here is exactly what this converter does with each of them.
Header cells and thead / tbody wrappers
A row of <th> cells becomes the Markdown header. The converter reads rows in document order, so <thead> and <tbody> wrappers make no difference to the output.
<table>
<thead>
<tr><th>Product</th><th>Price</th></tr>
</thead>
<tbody>
<tr><td>Keyboard</td><td>$79</td></tr>
</tbody>
</table>Produces | Product | Price | followed by the | --- | --- | separator and one data row for the keyboard.
Tables with no header row
Markdown tables must have a header, so the first <tr> is always promoted — even when it contains only <td> cells. If that row is real data, add a proper <th> row to the HTML before converting.
<table>
<tr><td>Keyboard</td><td>$79</td></tr>
<tr><td>Mouse</td><td>$29</td></tr>
</table>Keyboard and $79 end up as the column headings, and only the mouse row remains as data.
Pipe characters inside cells
A raw pipe would split a cell into two columns. Every pipe found in cell text is escaped with a backslash automatically, so shell commands and regex patterns survive the conversion.
<td>cat access.log | grep 500</td>Becomes | cat access.log \| grep 500 | — the pipe prints as a character instead of creating a new column.
colspan and rowspan
Markdown has no merged cells. Rows that span columns come out short, so the converter pads every row with empty cells until all rows match the widest one. The table stays valid, but you may want to redistribute the values by hand.
<table>
<tr><th>Item</th><th>Qty</th><th>Total</th></tr>
<tr><td colspan="2">Subtotal</td><td>$108</td></tr>
</table>The second row becomes | Subtotal | $108 | | — three columns wide, with the merge flattened into a trailing empty cell.
Links, bold text and images in cells
Cells are converted using their text content, so inline HTML is flattened to plain text. Re-add the Markdown formatting afterwards if the link or emphasis matters.
<td><a href="https://example.com">Docs</a></td>
<td><strong>Sold out</strong></td>You get | Docs | Sold out | with the anchor and the <strong> tag removed; the URL is not carried into the Markdown.
Several tables in one paste
Every <table> in the input is converted in document order and separated by a blank line, so you can dump a whole page of HTML in at once instead of converting table by table.
<table><tr><th>Q1</th></tr><tr><td>12%</td></tr></table>
<table><tr><th>Q2</th></tr><tr><td>18%</td></tr></table>Outputs two independent Markdown tables, one for Q1 and one for Q2, separated by a blank line.
Where Markdown tables actually render
Tables are not part of core CommonMark — they come from the GitHub Flavored Markdown spec. That means the output of this converter renders beautifully in some places and shows up as raw pipes in others.
| Platform | Support | Notes |
|---|---|---|
| GitHub / GitLab | Full | GFM tables render in READMEs, issues, PRs, comments and wikis. |
| Obsidian | Full | Renders in reading view and live preview; column alignment supported. |
| VS Code | Full | The built-in Markdown preview renders GFM tables out of the box. |
| Full | Supported in the Markdown editor on both old and new Reddit. | |
| Notion | Partial | Pasting a Markdown table converts it into a Notion table block, not literal pipes. |
| Discord | None | Discord has no table support — pipes show literally. Use a code block to keep columns aligned. |
| Slack | None | No table syntax. Paste inside a code block or attach the table as a snippet. |
How to convert an HTML table to Markdown
Paste your HTML
Drop the table markup into the HTML editor on the left. You can paste a single <table> element or a whole page — only tables are converted.
Or import a file
Use the upload button to load an .html, .htm or .txt file straight from disk instead of pasting.
Check the result
The Markdown regenerates automatically as you type. Compare the Markdown code with the rendered preview underneath it to confirm the columns line up.
Copy or download
Copy the Markdown to your clipboard, or export it as a .md file ready to drop into a repository.
Frequently Asked Questions
How do I convert an HTML table to Markdown?
Paste the HTML into the editor on this page. The converter parses every <table> element, turns each row into a pipe-delimited line, adds the dashed separator row under the header, and escapes any pipe characters found in cell text. The Markdown appears instantly and can be copied or downloaded as a .md file.
Can I just leave the HTML table in my Markdown file instead?
On GitHub and most static site generators, raw HTML inside a Markdown file does render. But it breaks in plain-text contexts, in editors that sanitise HTML, and in Markdown-to-PDF pipelines. A native pipe table is shorter, diffs cleanly in Git and stays readable in the source file, which is why converting is usually worth it.
What happens to colspan and rowspan when converting?
Markdown tables cannot merge cells, so spans are flattened. A row that spans two columns produces fewer cells than its neighbours, and the converter pads it with empty cells so every row has the same width. The table remains valid Markdown, but you should review merged headers and subtotal rows manually.
Can I convert an Excel or Google Sheets table to Markdown?
Yes. Copying a range from Excel, Numbers or Google Sheets puts an HTML table on your clipboard, so pasting it into the HTML editor works directly. The spreadsheet styling is discarded and you get a plain Markdown table with the first row as the header.
Are links and bold text inside cells preserved?
No. Cells are converted using their text content only, so an anchor becomes its link text and a <strong> element becomes plain words. This keeps the output predictable and safe to paste anywhere. If a link matters, add the Markdown link syntax back into that cell after converting.
Why is my Markdown table not rendering?
The three usual causes are a missing separator row of dashes directly under the header, a platform that does not support tables at all such as Discord or Slack, or an unescaped pipe character inside a cell that silently adds a column. A blank line before the table also helps in strict parsers.
Do the pipes need to line up in the source?
No. Markdown parsers only care about the number of pipes per row, not about visual alignment, so | Name | Age | and |Name|Age| render identically. Aligned columns are purely a readability convenience for whoever edits the raw file later.
How do I put a line break inside a table cell?
Markdown table rows cannot contain real newlines, so a cell with multiple lines of HTML is collapsed into a single space-separated line during conversion. To force a visual break afterwards, insert a <br> tag inside the cell — every GFM-compatible renderer honours it.
Can I convert more than one table at a time?
Yes. Paste as much HTML as you like: every <table> element is converted in document order and the resulting Markdown tables are separated by a blank line. This makes it practical to convert an entire documentation page in a single step.
Is my HTML uploaded to a server?
No. Parsing and conversion happen locally in your browser using the built-in DOM parser, so nothing leaves your machine. That makes the tool safe for internal reports and unpublished documentation, and it works offline once the page has loaded.