Paste HTML and instantly view its structure as a visual tree. The HTML Structure Viewer shows how every element is nested inside its parent, including ids, classes, links, images and short text snippets, so you can understand the HTML hierarchy of a page or fragment at a glance. Everything runs in your browser and your HTML is never executed or uploaded.
The HTML Structure Viewer turns any piece of HTML into a clear, expandable tree. Paste a complete page, a fragment, or a copied section of markup and you immediately see the HTML hierarchy: which elements exist, how they are nested inside each other, and which ids, classes, links and images they carry. It is an inspection tool only - your HTML is parsed safely, never executed, and never modified.
HTML is a nested language. Every element sits inside a parent element, and can contain child elements of its own. Together these parent-child relationships form the HTML structure, also called the HTML tree or HTML hierarchy. A typical page starts with html, which contains head and body, and the body contains sections such as header, main and footer, each with their own children.
#id, .class, [href], [src], [alt] and [name].Input HTML:
<body>
<header>
<nav><a href="/contact">Contact</a></nav>
</header>
<main class="container">
<h1>Welcome to our website</h1>
<section id="about">
<img src="image.jpg" alt="Team">
</section>
</main>
</body>
HTML tree output:
html
└── body
├── header
│ └── nav
│ └── a[href="/contact"]
│ └── Contact
└── main.container
├── h1
│ └── Welcome to our website
└── section#about
└── img[src="image.jpg"][alt="Team"]
Nesting means that one element is placed completely inside another. In the example above, the a element is nested inside nav, which is nested inside header. The depth of an element is the number of ancestors it has. The Depth value in the summary shows the deepest level in your HTML, which is a quick indicator of how complex the markup is.
header, main, nav and footer are used and nested sensibly.The HTML structure is what your source code describes. The DOM (Document Object Model) is the live tree the browser builds from that source, after applying parsing rules, running JavaScript, and loading resources. Browser developer tools show the DOM, which can differ from your source because scripts add or remove elements. This HTML Structure Viewer shows the structure of the HTML you paste, without executing scripts or loading external content, so what you see reflects your markup rather than the runtime HTML DOM structure.
script and style elements is not displayed.