HTML table to JSON converter

Paste the page source or just the table, and pick the table number when the page has more than one.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter html containing a table, table number on the page and first row is the header.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

A built-in reader collects <tr> rows and <td>/<th> cells, strips tags inside cells, decodes entities such as &amp; and collapses spaces. A cell spanning columns or rows via colspan or rowspan repeats its value in every slot it covers. The first row supplies the object keys when selected.

Example

Inputs: Table number on the page = 1, First row is the header = yes. Result: JSON: [ { "المنتج": "قهوة عربية", "السعر": "45", "الكمية": "3" }, { "المنتج": "تمر سكري", "السعر": "30", "الكمية": "5" } ]; Tables found: 1; Records: 2.

<table>
  <tr><th>المنتج</th><th>السعر</th><th>الكمية</th></tr>
  <tr><td>قهوة عربية</td><td>45</td><td>3</td></tr>
  <tr><td>تمر سكري</td><td>30</td><td>5</td></tr>
</table>
[
  {
    "المنتج": "قهوة عربية",
    "السعر": "45",
    "الكمية": "3"
  },
  {
    "المنتج": "تمر سكري",
    "السعر": "30",
    "الكمية": "5"
  }
]

Limits and caveats

  • Tables built from div elements and CSS instead of <table> are not read.
  • A table nested inside a cell is merged into that cell as text.
  • All values stay strings exactly as shown in the table.

Questions about this tool

How do I copy a table from a website?

Open the page, right click and choose view source or inspect, then copy the code from <table> to </table> and paste it here.

What about duplicate or blank headers?

A repeated header gets a suffix such as k_2 and a blank one becomes column_3 by position, so no value is lost.

How are merged cells handled?

A cell spanning several columns or rows repeats its value in each slot it covers, so the result stays rectangular.