Convert HTML markup to a JSON tree — parse any HTML and output a structured JSON representation of the DOM.
Click the left panel and paste your data (Ctrl+V / Cmd+V), or use the Paste or Sample buttons.
Press the 🌐 Convert to JSON button. The result appears instantly in the right panel.
Any syntax issues in your input are shown in the red error bar with a clear description so you can fix them quickly.
Click Copy to copy to clipboard or Download to save the file locally.
Each HTML element is represented as a JSON object with three keys: "tag" (the element name), "attributes" (an object of attribute key-value pairs), and "children" (an array of child nodes or text strings).
Yes. Text nodes appear as plain strings in the children array, interspersed with element objects at the correct position.
Yes — the browser's built-in DOMParser is used internally, which automatically corrects unclosed tags and other common HTML errors before converting.
No. HTML comments are stripped from the output for cleaner JSON. Only element nodes and text content are included.
Yes. The DOMParser runs entirely in your browser. No HTML is ever sent to a server.
Yes — paste an entire HTML page and the tool will output the full DOM tree starting from the root html element.