What this HTML validator checks
This HTML validator focuses on the structural mistakes that cause real rendering bugs: tags that are opened but never closed, closing tags in the wrong order, stray end tags, duplicate attributes and duplicate IDs. It walks through your markup, keeps track of open elements the way a browser does, and reports each problem with its line and column. It understands HTML's rules for void elements (<img>, <br>, <input>), raw-text elements (<script>, <style>) and elements whose end tags are optional (<p>, <li>, <td>).
Example
<!DOCTYPE html>
<html>
<body>
<div id="main"><section><p>Hello <b>world</p></section>
<img src="a.png">
<div id="main"></div>
</body>
</html>
3 error(s). Line 4, column 1: <div> is not closed before </body>
Line 4, column 34: <b> is not closed before </p>
Line 6, column 1: Duplicate id "main"
The <b> opened inside the paragraph is never closed, the outer <div> is never closed, and the ID main is used twice. Once these errors are fixed, the validator also reports the warning that <img> is missing an alt attribute.
Errors and warnings
Errors (structure)
- Unclosed elements:
<div>,<span>,<section>and others that must be closed. Elements with optional end tags, like<li>and<p>, are closed implicitly as browsers do. - Mis-nesting:
<b><i>text</b></i>closes elements in the wrong order. - Stray closing tags with no matching opening tag.
- Duplicate attributes on one element, such as two
classattributes, where browsers keep only the first. - Duplicate IDs, which break
getElementById, labelforlinks and fragment anchors. - Malformed tags: a tag missing its
>, an unclosed attribute quote, an unclosed comment, or a<script>that never ends.
Warnings (best practice)
- Missing
alton images, needed by screen readers and shown when images fail to load. Usealt=""for purely decorative images. - Obsolete elements such as
<center>,<font>and<marquee>; use CSS instead. - Closing tags on void elements (
</br>), and self-closing syntax on normal elements (<div/>), which browsers ignore, so the element stays open. - Missing
<!DOCTYPE html>in a full document, which puts browsers into quirks mode.
Why these errors matter
Browsers never refuse to render HTML; they repair it. An unclosed <div> is closed at some later point chosen by the parsing algorithm, which can pull following content into the wrong container and break a layout or a CSS grid far from the actual mistake. The self-closing <div/> trap is common in markup converted from JSX or XML: the / is ignored, so everything after it becomes a child of that div. Structural validation makes these repairs visible.
Scope and limits
This is a fast structural checker, not a full implementation of the W3C Nu HTML Checker. It does not verify that every attribute is allowed on an element, that content models are respected (for example, a <div> inside a <p>), or ARIA usage. For a final standards audit of a public page, the W3C service is the reference; for everyday checks while editing templates and emails, this tool gives instant feedback without sending your markup anywhere.
After fixing structure, indent the markup with the HTML Formatter so problems are easier to spot next time, or compress it with the HTML Minifier. To see the page rendered, use the HTML Viewer.