Skip to content

HTML Table to Markdown Converter

Paste HTML <table> code and get a Markdown table as you type; headers and <br> line breaks are kept.

Paste HTML or a table from a web page

Sample data shown — paste or drop your own to replace it.

Converts as you type. Rendered tables keep their cells and line breaks.
Output
| ID    | Service          | Plan       | Monthly Cost |
| ----- | ---------------- | ---------- | ------------ |
| SRV-1 | Cloud Hosting    | Pro Tier   | $29.00       |
| SRV-2 | Managed Database | Enterprise | $99.00       |
| SRV-3 | Edge CDN         | Standard   | $15.00       |
3 rows × 4 columns
Rendered Preview
IDServicePlanMonthly Cost
SRV-1Cloud HostingPro Tier$29.00
SRV-2Managed DatabaseEnterprise$99.00
SRV-3Edge CDNStandard$15.00

How to convert an HTML table to Markdown in 3 steps

  1. 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.

  2. 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.

  3. Copy the Markdown

    Click Copy Markdown and paste it into a README, issue or wiki, or download it as .md.

Example

HTML table source
<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 &amp; 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>
Markdown 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 other formats to Markdown

Convert Markdown to…

Browse all 36 tools

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 &amp; 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 &amp; and &nbsp; 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 ![alt](url), <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), ![alt](https://example.com/img.png).

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

PlatformSupportNotes
GitHub & GitLab SupportedThe GFM output renders in READMEs, issues, PRs and wikis; <br> works inside cells.
Obsidian SupportedRenders in Reading view and Live Preview.
Pandoc SupportedReads pipe tables with its pipe_tables extension, enabled by default for Pandoc Markdown.
GitHub Pages (Jekyll) SupportedBuilt with Kramdown, not GFM, but pipe tables work.
CommonMark core ExtensionTables 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 ![alt](https://…), <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.