How to Convert an HTML Table to Markdown
Convert an HTML table to GitHub Flavored Markdown, check the output in Preview, and handle merged or missing table headers.
Convert a simple HTML table
Copy the HTML below into Paste HTML and open Preview. The header becomes the first row, pipes separate the cells, and the line of dashes separates the header from the data.
HTML input
<table>
<tr><th>Plan</th><th>Seats</th></tr>
<tr><td>Team</td><td>5</td></tr>
</table>Markdown output
| Plan | Seats |
| --- | --- |
| Team | 5 |Use Raw to inspect the pipes, then copy the Markdown into a GitHub README or choose Download .md.
Convert a table with merged cells
A GitHub Flavored Markdown table has one Markdown cell per column. HTML attributes such as colspan and rowspan create a layout that a pipe table cannot preserve. The converter keeps the row text in a list.
HTML input
<table>
<tr><th colspan="2">Plan details</th></tr>
<tr><td>Team</td><td>5 seats</td></tr>
</table>Markdown output
- Plan details
- Team ยท 5 seatsFor a pipe table, edit the source so every row has the same number of unmerged cells. For example, move a heading that spans all columns above the table or place it in a caption. Review nested tables separately, since they also produce a list.
Find a missing table or header
If extraction drops the table with other surrounding content, turn off Extract main content or paste the <table> element on its own. If the source has no header row, the converter supplies labels such as Column 1. Rename them before publishing. Escape a literal pipe as \| if you edit a cell by hand.
To open a document with several tables, use the HTML file converter. For a table that appears after a public page loads, try the JavaScript website converter.
See the GitHub Flavored Markdown table specification for the syntax supported by GitHub.