Wapgee Logowapgee

Tools / HTML Table → Markdown / CSV

HTML Table to Markdown & CSV

Paste a table, or the whole page around it, and get a clean GitHub-flavoured Markdown table or a CSV file. Merged cells, header rows, links and line breaks are handled, entirely in your browser.

HTMLnothing pasted yet

Paste HTML on the left, a whole page or just the <table>, and the Markdown or CSV appears here.

Runs entirely in your browser. The HTML you paste is never uploaded or stored.

Getting the table out of a page

You rarely have the HTML of a table sitting in a file. It is on a pricing page, in a wiki, in a Confluence export, or in an email. The quickest route is the browser's developer tools: right-click any cell, choose Inspect, walk up the tree to the <table> element, right-click it and choose Copy → Copy outerHTML. Paste that here.

Pasting a whole page works too. Every top-level table in the document is listed, with its caption when it has one, and you pick the one you want. Nested tables (a table inside a cell) are folded into the parent cell as text, because neither Markdown nor CSV can represent them.

HTML
<table>
  <tr><th>Plan</th><th>Price</th></tr>
  <tr><td>Free</td><td>$0</td></tr>
  <tr><td>Pro</td><td>$12</td></tr>
</table>
Markdown
| Plan | Price |
|:-----|:------|
| Free | $0    |
| Pro  | $12   |

How the header row is found

A row is treated as the header when it lives in a <thead>, or when every cell in the first row is a <th>. Many real tables use neither (a first row of plain <td> cells styled bold with CSS), so the detection is only a default. The First row is header box overrides it either way.

GFM tables must have a header row. When you switch it off, the output keeps an empty header line above the alignment row so the table still renders; the first data row is not promoted. CSV has no such rule, and simply emits every row.

What happens to colspan and rowspan

Neither Markdown nor CSV has merged cells, so a spanning cell has to be flattened into a rectangle. Two strategies are offered:

  • Repeat value copies the cell's text into every position it covered. Choose this for data you will sort, filter or load into a spreadsheet: each row stays self-describing.
  • Leave blank keeps the text once, in the top-left position, and leaves the rest empty. Choose this when the output is for reading and you want it to look like the original.
HTML with a rowspan
<tr><td rowspan="2">Team</td><td>Seats</td></tr>
<tr><td>Projects</td></tr>
Repeat value
| Team | Seats    |
| Team | Projects |

A warning under the output tells you when merged cells were expanded, so you know the grid is wider or taller than the visible table was.

Bold, code, links and line breaks

With Keep bold, code & links on, <strong> becomes **bold**, <code> becomes a backtick span, and an absolute link becomes [text](https://…). Relative links keep their text only, because a Markdown file has no base URL to resolve them against. Images are replaced by their alt text. Turn the option off for plain text in every cell.

Line breaks inside a cell (<br>, or several <p> elements) are a problem for GFM, whose rows are single lines. They are written as a literal <br>, which GitHub, GitLab and most renderers honour inside a table. In CSV the break stays a real newline inside a quoted field, which every spreadsheet reads correctly.

A pipe character in a cell would otherwise start a new column, so it is escaped as \| in Markdown. CSV output goes through the same quoting rules as the CSV ⇌ JSON converter: fields containing the delimiter, a quote or a newline are wrapped in quotes and inner quotes are doubled.

Markdown or CSV?

Reach for Markdown when the table is going into a README, a pull request, documentation, a Notion or Obsidian page, or a prompt for a language model. Aligned columns (the default) make the source readable; switch Align columns off for a compact form that diffs better.

Reach for CSV when the table is data: something to open in Excel or Google Sheets, load with pandas, or feed into the CSV ⇌ JSON converter on its way to an API. The tab delimiter (TSV) is the safest choice when cells themselves contain commas.

Need to edit the table after converting? Paste the Markdown into the Markdown Table Generator for a spreadsheet-style grid. For a whole article rather than one table, the HTML to Markdown converter handles headings, lists and paragraphs.

What does not survive the trip

  • Cell colours, widths, borders and fonts. Markdown tables carry text and alignment only; CSV carries text only.
  • Nested tables, which are flattened into the text of the cell that contains them.
  • Multiple header rows. A two-row header (common with a spanning group title) is kept as data rows; the first becomes the Markdown header.
  • Column alignment is read from the align attribute or an inline text-align style on a cell. Alignment set in an external stylesheet is not visible in pasted HTML and is not applied.
  • Content rendered by JavaScript after page load. Copy the table from the developer tools, not from “view source”, and you get the rendered rows.

Why a dedicated table converter

General HTML-to-Markdown converters do one of two things with a <table>: pass it through as raw HTML, or emit a pipe table that falls apart the moment a cell spans two columns. Real tables (pricing pages, API references, comparison charts, Confluence exports) are full of colspan, rowspan, header rows that are not marked as headers, and links inside cells. This tool reads the table the way a browser lays it out, builds a rectangular grid first, and only then writes Markdown or CSV. The result renders on GitHub, GitLab, Notion and Obsidian, or opens straight into a spreadsheet.

What is converted

  • Every top-level table in the pasted HTML, with its caption, so you can convert a page with several tables one at a time.
  • <thead>, <tbody> and <tfoot> in render order, plus loose <tr> rows.
  • Column alignment from align attributes and inline text-align styles, written into the Markdown alignment row.
  • Bold, italic, inline code and absolute links as Markdown inline syntax; images as their alt text; scripts and styles dropped.
  • Pipes escaped, line breaks written as <br> in Markdown and kept as quoted newlines in CSV.

Markdown tables for LLM prompts

A Markdown table is one of the most token-efficient ways to hand structured data to a language model: far lighter than the HTML it came from and easier for the model to read than JSON. Convert the table here, then check the size with the Token Counter before it goes into a prompt. Going the other way, from a model's Markdown output to a page, the Markdown to HTML converter renders it back.

Related converters

For a whole article rather than one table, use HTML to Markdown. To edit the result cell by cell, open it in the Markdown Table Generator. To turn the CSV into JSON for an API, use the CSV ⇌ JSON converter.

FAQ

Is the HTML I paste uploaded anywhere?

No. The HTML is parsed with your browser’s own DOM parser and converted on your machine. Nothing is sent to a server, logged, or stored.

How do I get the HTML of a table from a web page?

Right-click a cell, choose Inspect, select the <table> element in the tree, then right-click it and choose Copy → Copy outerHTML. Paste that into the converter. Pasting the whole page also works; every table found is listed so you can pick one.

What happens to colspan and rowspan?

Markdown and CSV have no merged cells, so a spanning cell is expanded into a rectangle. Choose “repeat value” to copy the text into every covered cell (best for data) or “leave blank” to keep it once and leave the rest empty (closest to the original look).

Why is there an empty header row in my Markdown?

GitHub-flavoured Markdown requires a header row. When “First row is header” is off, an empty header line is written so the table still renders, and every source row is kept as data.

Can I convert an HTML table to Excel or Google Sheets?

Yes. Switch the output to CSV, download the file, and open it in Excel or import it into Sheets. Use the tab delimiter if your cells contain commas.

Does it keep links and bold text?

In Markdown, yes: bold, italic, inline code and absolute links become their Markdown equivalents when “Keep bold, code & links” is on. CSV output is always plain text.