HTML Tools

HTML to JSON Converter

Ready
HTML Input
JSON Output
0 elements0 tables0 items0 warnings
No extraction summary yet.
No JSON generated yet.

HTML Tools Guide

HTML to JSON Converter for practical developer workflows

This HTML to JSON Converter helps you turn pasted markup into structured JSON for scraping prototypes, CMS migrations, documentation extraction, link audits, image inventories and API mock preparation. Choose DOM tree JSON when you need the page structure, table mode for rows, assets mode for links/images/headings, or text mode for readable content. Conversion runs in your browser after the page loads, so quick extraction work does not require sending pasted HTML to a backend service.

account_tree

Extract DOM structure

Serialize elements, tag names, attributes, text nodes, comments and child nesting into readable JSON.

table_view

Convert table rows

Detect tables, choose one table, and output rows as arrays or objects using the first row as field names.

download

Copy or download JSON

Choose pretty indentation or compact output, review extraction counts, then copy JSON or download a devbruh-suffixed file.

What HTML to JSON extraction means here

HTML is a document format, while JSON is a data format. This page uses the browser parser to turn pasted markup into an in-memory DOM, then extracts the part you choose into JSON. It is useful when you need structure, not a rendered screenshot of the page.

DOM tree mode keeps nested elements with tag names, attributes and optional text or comments. Table mode reads rows from one detected table and can return an array of objects or an array of arrays. Assets mode extracts links, images and headings. Text mode returns a text summary plus block-level text from paragraphs, list items, table cells and headings.

Relative URLs are preserved exactly as they appear in the source HTML. Scripts are not executed, remote pages are not fetched, and JavaScript-generated content will not appear unless it is already present in the pasted markup.

Common HTML to JSON use cases

Scraping prototypes: inspect which headings, links, images, text blocks or tables are available before writing a parser.

CMS migration: convert static markup snippets into structured data for cleanup, mapping or review.

Documentation extraction: pull headings, paragraphs, lists or table rows from docs pages into JSON fixtures.

Link audits: use assets mode to collect anchor text and href values from pasted HTML.

Image inventories: extract image src and alt values when checking content accessibility or migration coverage.

API mock preparation: turn simple tables or page snippets into JSON that can seed tests, demos or prototypes.

HTML to JSON examples

A small HTML snippet with a link, image, heading and table can be extracted in different ways:

<section data-page="tools">
  <h1>Developer tools</h1>
  <a href="/tools/html-tools/">HTML Tools</a>
  <img src="/icons/favicon-32x32.png" alt="devbruh icon">
  <table>
    <tr><th>Tool</th><th>Status</th></tr>
    <tr><td>HTML JSON</td><td>Ready</td></tr>
  </table>
</section>

In assets mode, the output focuses on links, images and headings:

{
  "links": [
    { "text": "HTML Tools", "href": "/tools/html-tools/" }
  ],
  "images": [
    { "src": "/icons/favicon-32x32.png", "alt": "devbruh icon" }
  ],
  "headings": [
    { "level": 1, "text": "Developer tools" }
  ]
}

In table mode, the same table can become an object array such as [{ "Tool": "HTML JSON", "Status": "Ready" }]. Use DOM tree mode when the nested structure matters more than extracted fields.

HTML to JSON Converter FAQ

What does this HTML to JSON Converter do?

It parses pasted HTML and converts it into JSON using DOM tree, selected table, links/images/headings, or text extraction modes. You can include attributes, text nodes and comments, choose pretty or compact JSON, copy the result, or download a JSON file.

Can it convert HTML tables to JSON?

Yes. Table mode detects tables in the pasted HTML and lets you choose one table. You can output the selected table as an array of objects using the first row as keys, or as an array of arrays.

Can it extract links and images?

Yes. The assets mode extracts links, images and headings into structured JSON. Links include visible text and href values, images include src and alt values, and headings include level and text.

Does it execute scripts in HTML?

No. The page parses pasted HTML with the browser parser and reads the resulting nodes for extraction. It does not run pasted scripts, fetch remote pages, or render JavaScript-generated content.

Is the output valid JSON?

Yes. Output is generated with JSON.stringify, so the result is valid JSON for the selected extraction mode. Empty or unsuitable input can still produce empty arrays, empty text, or warnings that need review.

Is HTML to JSON conversion processed locally?

Yes. The HTML to JSON Converter runs with JavaScript in your browser after the page loads. Your pasted HTML is not sent to devbruh.dev servers for conversion.

Extraction, validation and safety notes

This tool parses pasted markup and extracts data from that parsed tree. It does not scrape live URLs, run browser automation, evaluate scripts, load remote content, preserve CSS rendering, or infer data that is not present in the HTML source.

Malformed HTML can be repaired by the browser parser before extraction, which may change the structure compared with the original source. Relative links and image paths stay relative, so resolve them against the correct site before using the JSON elsewhere.

The output is valid JSON, but validity is not the same as correctness for your import target. Check field names, empty values, table headers, repeated rows, comments, whitespace trimming and selected mode before treating the file as production data.