HTML Table to Markdown Converter
Paste HTML <table> code and get a Markdown table as you type; headers and <br> line breaks are kept.
Sample data shown — paste or drop your own to replace it.
How to convert an HTML table to Markdown in 3 steps
Paste the HTML
Paste <table> markup into the Paste HTML box, upload an .html file, or paste a table you copied from a web page, Word or Google Docs. Anything around the table is ignored.
Check the table
It converts as you type. Header cells (<th>) in the first row become the header; with none, the first row is used. Open Edit grid to fix cells or set alignment.
Copy the Markdown
Click Copy Markdown and paste it into a README, issue or wiki, or download it as .md.
Example
<table>
<thead>
<tr><th>Package</th><th align="right">Size</th><th>Notes</th></tr>
</thead>
<tbody>
<tr><td>core</td><td align="right">12 KB</td><td>Fast & small</td></tr>
<tr><td>cli</td><td align="right">48 KB</td><td>Run with <code>npx</code><br>Node 20+</td></tr>
</tbody>
</table>| Package | Size | Notes | | ------- | ----: | -------------------------- | | core | 12 KB | Fast & small | | cli | 48 KB | Run with `npx`<br>Node 20+ |
Options explained
- Paste HTML box
- Converts 150 ms after you stop typing, and immediately on paste. The badge shows the detected format; the status line shows rows × columns or what went wrong. Only the first <table> in the text is converted.
- Upload file
- Reads an .html or .htm file from your computer without uploading it anywhere. CSV, TSV, JSON, Markdown, text and Excel files are accepted too..html · .htm · .csv · .tsv · .json · .md · .txt · .xlsx · .xls · .ods
- Paste / Sample / Clear
- Paste reads the clipboard, including a table copied from a web page or Word, where the cell boundaries are kept. Sample loads example markup, Clear empties the box.
- Edit grid / Markdown tabs
- The grid edits cells, headers and column alignment with undo and redo. Column alignment is taken from align attributes and text-align when most cells agree; set it here otherwise. The Markdown tab shows the source.
- Tools
- Auto-align (numbers right, text left), header case, transpose, and quick or deep clean for stray spaces and blank rows.Auto-align · UPPER · lower · Title Case · Transpose · Quick clean · Deep clean
- Flavor and Spacing
- GFM suits GitHub, GitLab and most editors. Padded lines up the pipes in the source; Compact removes the padding; No outer pipes drops the leading and trailing |.GFM · MultiMarkdown · Pandoc Pipe · reStructuredText · Org-mode · Padded / Compact / No outer pipes
- Collapsible <details>
- Wraps a long table in <details><summary> so it starts collapsed on GitHub.
- Output tabs, Download, Copy link
- Switch the output to HTML, CSV, TSV, JSON, LaTeX, SQL or Jira. Download saves the active format, .xlsx, .csv or .png. Copy link stores the table after #md= in the URL, which browsers do not send to a server.
Convert to and from other formats
Also useful
Convert other formats to Markdown
- CSV to Markdown TableConvert CSV text or .csv files, including quoted cells.
- Excel to Markdown TablePaste cells copied from Excel straight into a Markdown table.
- Google Sheets to Markdown TablePaste a copied range or a public sheet URL.
- TSV to Markdown TableConvert tab-separated text into a Markdown table.
- JSON to Markdown TableConvert a JSON array of objects into a table.
- SQL to Markdown TableConvert MySQL, PostgreSQL or SQLite CLI query output.
- Word Table to MarkdownPaste a table copied from Word or Google Docs.
- Web Table to MarkdownCopy a table from any web page and paste it here.
- Image to Markdown TableTurn a screenshot or photo of a table into Markdown in your browser.
- PDF to Markdown TableExtract a table from a PDF page, with OCR for scans.
- Universal Table to MarkdownPaste anything tabular; the format is detected for you.
Convert Markdown to…
- Markdown Table to CSVExport a Markdown table as RFC 4180 CSV.
- Markdown Table to TSVCopy as tab-separated values that paste cleanly into Excel and Sheets.
- Markdown Table to HTMLExport semantic <table> markup.
- Markdown Table to JSONExport rows as an array of JSON objects.
- Markdown Table to LaTeXExport LaTeX tabular code for papers and Overleaf.
- Markdown Table to SQLGenerate CREATE TABLE and INSERT statements.
- Markdown Table to ExcelDownload a real .xlsx with numbers, bold header and one sheet per table.
- Markdown Table to Google SheetsCopy a table that pastes cleanly into Google Sheets.
- Markdown Table to WordCopy a formatted table into Word or Google Docs, or download .docx.
- Markdown Table to ConfluenceWiki markup, storage format or a rich copy for the Cloud editor.
- Markdown Table to JiraConvert to Jira and Confluence wiki markup.
- Markdown Table to ImageRender the table as a PNG or SVG for slides and posts.
About this tool
Paste the source of an HTML table and the Markdown table appears as you type. Header cells in <thead> or the first row become the header, entities are decoded and <br> stays a line break. Links, images, bold, italic, strikethrough and inline code inside cells become Markdown, nested tables are flattened into their cell, and align attributes set the column alignment. Markdown tables cannot merge cells, so a colspan repeats its value across the columns it covers and a rowspan leaves the cells below it blank. A table copied from a rendered web page, Word or Google Docs can be pasted too. Everything runs in your browser.
- Converts as you paste; no Convert button
- <thead>/<th> headers, with the first row as fallback
- <br> kept as a line break; entities such as & decoded
- Links, images, bold, italic and code kept as Markdown
- Accepts a full page: finds the first <table> in it
- Paste a rendered table from a web page, Word or Google Docs
- Escapes | in cells so columns never shift
- Edit cells and alignment before copying
- Runs in your browser; markup is parsed, never executed
Technical details
How an HTML table is mapped to Markdown
The browser’s own HTML parser reads the markup, so unclosed tags and messy source are handled the way a browser would handle them. The converter takes the first <table>, reads its rows and cells, and writes a GFM pipe table. Inline markup that Markdown can express (links, images, bold, italic, code) is kept; HTML attributes and styling that it cannot are dropped.
- Header: If the first row has <th> cells it becomes the header. A table with no <th> (as many spreadsheets and exports produce) uses its first row. A blank header cell is named “Column N”.
- Cell text: Entities such as & and are decoded, runs of whitespace collapse to one space, and <br> stays as a <br> line break in the Markdown cell.
- Inline markup: <a href> with an absolute address becomes [text](url), <img> becomes , <b>/<strong> becomes **bold**, <i>/<em> becomes *italic*, <del>/<s> becomes ~~strike~~ and <code> becomes `code`. Relative links and images keep their text only.
- Merged cells: A colspan repeats the cell’s value in each column it covers; a rowspan puts the value in its first row and leaves the cells below blank. Both are expanded onto a grid so the columns stay lined up.
- Nested tables: A table inside a cell is flattened into that cell, one line per row joined with <br>, instead of adding rows to the outer table.
- Row headers: A <th> at the start of a body row is kept as the first cell of that row.
- Alignment: align attributes and CSS text-align set the column alignment when most cells agree; otherwise the delimiter row starts as ---. Use the column ▾ menu or Tools › Auto-align.
- Safety: The markup is parsed into an inert document, so scripts in pasted HTML do not run, and nothing is sent to a server.
Common problems and fixes
The first column is missing
Cause: A <th> row label is kept, so a missing column usually means its cells are not inside <td> or <th> tags, or sit in a table nested in another cell.
Fix: Check the source around the missing cells; a nested table is flattened into its parent cell, one line per row.
A value is repeated or blank where cells were merged
Cause: Markdown tables cannot merge cells, so a colspan repeats its value across the covered columns and a rowspan leaves the cells below it blank.
Fix: Delete or fill the repeated cells in Edit grid. Markdown tables cannot merge cells; see the merged cells page for an HTML fallback.
A link or image lost its address
Cause: Only links and images with a full http(s) or mailto address can be written as Markdown; a relative href or src has no site to resolve against.
Fix: Re-add the address in Edit grid: [text](https://example.com), .
Extra rows from a table inside a table
Cause: Rows of a nested table are read as ordinary rows of the outer one.
Fix: Copy just the inner table’s markup, or flatten the layout table before converting.
Only one of several tables was converted
Cause: The converter takes the first <table> it finds.
Fix: Paste each table separately.
Platform compatibility
| Platform | Support | Notes |
|---|---|---|
| GitHub & GitLab | Supported | The GFM output renders in READMEs, issues, PRs and wikis; <br> works inside cells. |
| Obsidian | Supported | Renders in Reading view and Live Preview. |
| Pandoc | Supported | Reads pipe tables with its pipe_tables extension, enabled by default for Pandoc Markdown. |
| GitHub Pages (Jekyll) | Supported | Built with Kramdown, not GFM, but pipe tables work. |
| CommonMark core | Extension | Tables are not part of core CommonMark 0.31.2; the renderer needs a GFM table extension. |
Frequently asked questions
How do I convert an HTML table to Markdown?
Paste the table’s HTML into the box above, or upload an .html file. The Markdown table is generated as you type; click Copy Markdown and paste it where you need it. Header cells in the first row become the table header.
Can I copy a table from a web page instead of its HTML?
Yes. Select the table on the page, copy it, and paste into the box: the cell boundaries come through. Links, images, bold, italic and code come through as Markdown, the same as when you paste source. The Web Table to Markdown page adds options for footnote markers and merged cells.
Does it keep links, images and bold text?
Yes. <a href> with an absolute address becomes [text](https://…), <img> becomes , <b>/<strong> becomes **bold**, <i>/<em> becomes *italic* and <code> becomes `code`. A relative link or image keeps only its text, because Markdown needs the full address.
How are colspan and rowspan handled?
They are expanded onto the grid so columns stay lined up. A colspan repeats the cell’s value in every column it covers; a rowspan puts the value in its first row and leaves the cells below blank. Markdown tables cannot merge cells, so keep an HTML table if the merged layout matters.
What happens to a <th> row label in a body row?
It should not be: a <th> at the start of a body row (<tr><th>Name</th><td>Alice</td></tr>) is kept as the first cell of that row. If a whole column is still missing, check that its cells are inside <td> or <th> tags.
Does it convert a whole web page with several tables?
Only the first <table> in the pasted text is converted, and everything outside it is ignored. Paste each table on its own to convert the others.
Does it read align attributes or CSS text-align?
Yes. align="right" or text-align: center on the cells sets the column alignment when most cells in the column agree. Otherwise the delimiter row starts as ---; click Tools › Auto-align to right-align number columns, or set left, center or right from a column’s ▾ menu in Edit grid.
Is my HTML uploaded anywhere?
No. The markup is parsed in your browser into an inert document, so scripts in it do not run, and nothing is sent to a server. A draft is saved in your browser’s local storage so a reload does not lose it.