<table> element or full HTML containing tables
Awaiting conversion
Paste your HTML table markup on the left and click Convert// paste html table โ get structured json instantly
Paste any HTML table markup and instantly convert it to structured JSON. Supports multi-header, nested tables, and custom key options. Free browser-based tool.
<table> element or full HTML containing tables
Awaiting conversion
Paste your HTML table markup on the left and click ConvertCopy any <table> element from your source code, browser DevTools, or full page HTML.
Toggle whether the first row acts as JSON keys and whether to minify or pretty-print the output.
Click Convert to get instant JSON. Copy to clipboard or download as a .json file.
HTML Table to JSON is a browser-based converter that parses <table> markup and outputs structured JSON arrays. It reads <th> elements as keys and <td> values as data โ no server upload needed, all processing happens locally.
Yes. If no <th> elements are found, or if you disable "Use first row as keys", each row is output as a plain JSON array instead of a keyed object. You get [["val1","val2"],["val3","val4"]] format.
Absolutely. Paste HTML that contains several <table> elements and the tool will parse all of them, returning an array where each item corresponds to one table with a table index and data array.
No. The conversion runs entirely in your browser using JavaScript. Your HTML and the resulting JSON never leave your machine, making it safe for sensitive or proprietary table data.
When enabled, the JSON output is wrapped as {"data": [...]} instead of a bare array. This is useful when feeding data into APIs or frameworks that expect a root object with a named key.
The tool extracts text content from each cell as-is. Colspan and rowspan attributes affect layout but the text content of the primary cell is still captured. Complex merge scenarios may need manual cleanup after conversion.
Yes โ when you copy from Excel or Google Sheets and paste into a web page or dev tools, the result is standard HTML table markup. Paste that into this tool and it will parse correctly in most cases.
HTML tables are one of the most common ways tabular data appears on the web โ from product listings and pricing pages to data exports from tools like Excel, Google Sheets, and database admin interfaces. But when you need that data in a format usable by a JavaScript application, REST API, or data pipeline, raw HTML markup gets in the way. That's where an HTML table to JSON converter becomes indispensable.
๐ก Looking for premium HTML templates and themes? MonsterONE offers unlimited downloads of HTML templates, UI kits, and web assets โ worth checking out for your next project.
JSON (JavaScript Object Notation) is the lingua franca of modern web data exchange. It's lightweight, human-readable, and natively understood by every major programming language and framework. Converting an HTML table to JSON transforms rows and columns into an array of objects, where each object represents a row and each key corresponds to a column header โ making it trivially easy to loop over, filter, sort, or send to an API endpoint.
Consider a table with columns "Name", "Price", and "Stock". After conversion, you get a clean structure like [{"Name":"Widget A","Price":"$9.99","Stock":"142"},...] โ ready to drop into a React component, pass to a charting library, or POST to a backend endpoint.
The converter intelligently inspects your HTML for <th> elements in the first row. When found, those cell values become the keys for every subsequent data row. This matches the most common real-world table pattern used in HTML documents. If your table uses <td> for every cell (including the header row), you can still opt to use the first row as keys using the provided toggle โ the tool will treat row zero as the key source and skip it in the data output.
Many pages embed several tables โ think Wikipedia articles, comparison pages, or scraped e-commerce listings. Rather than requiring you to isolate each table manually, this tool processes all <table> elements found in the pasted HTML in a single pass. The output is a top-level array where each entry contains a table index and its corresponding data rows. No more manual copy-paste loops.
Pretty Print vs. Minified: Pretty-printed JSON uses indentation and line breaks, making it easy to read and debug. Minified JSON strips all unnecessary whitespace, resulting in smaller payloads ideal for storing or transmitting data. Toggle the "Minify output" option based on your use case.
Object Wrapper: By default, the tool returns a bare JSON array [...]. Enabling "Wrap in object" produces {"data":[...]}. Many API frameworks and validation schemas require a root object rather than a bare array, so this option saves you a manual wrapping step.
<table> tag.<table> elements.For the best results, ensure your table markup is well-formed HTML. The parser is tolerant of minor errors, but extremely malformed markup (mismatched tags, missing closing elements) may affect output accuracy. When in doubt, run your HTML through the HTML Beautifier first to normalize the structure, then paste the cleaned output here.
If your table contains merged cells via colspan or rowspan, be aware that the text content of the primary cell is captured, but the logical expansion of merged cells into multiple rows/columns is not automatically handled. For complex merge scenarios, manual post-processing of the JSON output may be required.
Once you have your JSON, you can immediately use it in a variety of workflows. In a React application, paste it as a static data file and map over it with .map() to render components. In Node.js or Python scripts, read it with standard JSON parsing functions and process it with your preferred data manipulation library. For database imports, use the JSON as input to an ORM or bulk insert function. The structured, predictable format of the output makes integration straightforward regardless of your tech stack.
This tool runs entirely client-side in your browser. Your HTML input and the resulting JSON output are never transmitted to any server or stored anywhere. This makes it safe to use with sensitive data such as financial tables, internal pricing, or proprietary product information. All processing happens locally on your machine the moment you click "Convert".