Convert HTML to JSON
Tables, structure,
or parse in code.
Extract JSON from HTML tables, serialise an HTML structure to a JSON tree, or get ready-to-run Python and JavaScript parsing snippets. Three modes, one tool.
Choose the mode that matches your data source and use case.
Paste any HTML containing a <table> element and get a JSON array of objects. Column names come from the header row. Multiple tables are supported. Best for data copied from websites, reports, spreadsheet exports and email newsletters.
<table> <tr><th>name</th><th>age</th></tr> <tr><td>Alice</td><td>30</td></tr> </table>
[{"name":"Alice","age":30}]
Serialise any HTML snippet to a JSON tree. Each element becomes an object with tag, attrs, text and children fields. Best for analysing HTML structure, extracting metadata, or converting component markup to a JSON representation.
<div class="card"> <h2>Title</h2> <p>Body text</p> </div>
{"tag":"div","attrs":
{"class":"card"},
"children":[...]}
Get ready-to-run code for parsing HTML to JSON in Python (BeautifulSoup, requests+lxml), Node.js (cheerio) or the browser (DOMParser). Covers table extraction, full DOM parsing and CSS selector-based extraction. Copy and run without any modification.
from bs4 import BeautifulSoup
soup = BeautifulSoup(html, 'html.parser')
rows = soup.select('table tr')
Be aware of these constraints before using the browser-based converter.
The four most common workflows where HTML data needs to become JSON.
Wikipedia tables, financial data pages, sports statistics, price comparison sites — all present data as HTML tables. Mode 1 extracts the table as a JSON array instantly — ready to process, save or import into a database without writing any parsing code.
Migrating content from WordPress, Drupal, Mailchimp or any CMS often involves converting HTML content to structured JSON for import into a headless CMS, a database or a static site generator. Mode 2 gives you the structural JSON representation of any HTML snippet.
Building a scraper to extract product data, job listings, news articles or any structured content from HTML pages? Mode 3 gives you the exact Python or Node.js code to paste into your script — with the right library imports, error handling and JSON output.
n8n, Zapier and Make workflows often receive HTML content from webhooks, email parsers or HTTP requests. Converting the HTML snippet to JSON lets you use standard JSON manipulation nodes instead of custom HTML parsing — paste the HTML into Mode 1 to get the JSON structure your workflow needs.
HTML parsed by your
own browser. No upload.
The table and structure modes use the browser's native DOMParser — the same engine that renders every web page you visit. Your HTML is parsed locally, the DOM is traversed in JavaScript, and the JSON is built entirely in memory. Nothing leaves your device.
The code snippets are generated from your language and target selection — no API call, no server round-trip. Each snippet is production-ready: correct imports, error handling, and JSON serialisation — copy and run directly in your environment.
