Convertee/Guide

How to Convert HTML Tables to JSON

Last updated: 2026-04-15

HTML tables are everywhere: API documentation, government data portals, pricing pages, sports statistics. The data is right there in the DOM, but extracting it manually means a lot of copy-pasting and reformatting. Converting HTML <table> markup directly to JSON gives you structured data ready for processing.

Step-by-Step: Convert HTML Table to JSON

  1. Open Convertee and select HTML Table as the source and JSON as the target format.
  2. Paste your HTML table markup into the input panel. You only need the <table> element and its contents, not the full page HTML.
  3. Click Convert (Cmd+Enter).
  4. Copy the JSON output or download it as a file.

Parsing happens entirely in your browser using the HTML Living Standard table model. No data is sent anywhere.

Before / After Example

Input HTML:

<table>
  <thead>
    <tr>
      <th>City</th>
      <th>Country</th>
      <th>Population</th>
    </tr>
  </thead>
  <tbody>
    <tr><td>Seoul</td><td>South Korea</td><td>9776000</td></tr>
    <tr><td>Tokyo</td><td>Japan</td><td>13960000</td></tr>
    <tr><td>Berlin</td><td>Germany</td><td>3645000</td></tr>
  </tbody>
</table>

Output JSON:

[
  { "City": "Seoul", "Country": "South Korea", "Population": "9776000" },
  { "City": "Tokyo", "Country": "Japan", "Population": "13960000" },
  { "City": "Berlin", "Country": "Germany", "Population": "3645000" }
]

How It Works

Convertee parses the HTML using the browser's native DOMParser. It locates all <table> elements, reads <th> cells as column headers, and maps each <tr> in the body to a JSON object. If no <thead> is present, the first row is treated as the header.

Common Use Cases

Handling Complex Tables

Frequently Asked Questions

Do I need to paste the entire HTML page?
No. You only need the <table> element and its contents. Convertee will extract tables from a full HTML document, but pasting just the table is sufficient and faster.
How are colspan and rowspan handled?
Merged cells (colspan/rowspan) are expanded so every row has the same number of columns. The merged value fills the first cell; remaining cells are left empty.
Are links and formatting in table cells preserved?
No. HTML tags like <a>, <strong>, and <em> are stripped. Only the text content of each cell is included in the JSON output. This ensures clean, structured data.

Related Guides

Ready to convert? Try it now — no sign-up required.

Open Converter