HTML Validator
Find unclosed, mismatched and stray HTML tags, plus images without alt text, with line numbers. Paste a snippet or full page; the check runs in your browser.
Find unclosed and mismatched HTML tags
A missing </div> can push a footer into a sidebar or break a whole email layout, and browsers repair broken markup silently, so the mistake is easy to miss. Paste your HTML, click Validate HTML, and the checker lists each structural problem with its line number.
What the checker reports
| Report | Example input | Usual fix |
|---|---|---|
| Mismatched nesting | <div><p>Hi</div> | Close the inner element first: </p></div> |
| Stray closing tag | </span> with no <span> before it | Delete it, or add the missing opening tag |
| Never closed | <section> with no </section> | Add the closing tag where the section should end |
| Image without alt text | <img src="logo.png"> | Add a description, or alt="" for a purely decorative image |
Void elements such as <br>, <img>, <input> and <meta> never need a closing tag, and a tag that ends in /> is treated as closed.
Worked example
Paste <div><p>check my structure</div>, the same snippet shown as the editor's placeholder. Validating it gives two reports. First, </div> closes the <p> that was opened on line 1, which is mismatched nesting. Second, the <div> is never closed, because its closing tag was used up by the paragraph. Both come from one missing </p>. Add it before </div>, validate again, and the result shows that no structural problems were found.
This is why one mistake often produces several reports. Fix the earliest line first and validate again rather than editing every reported line at once.
What it does not check
This is a structure check, not a full specification validator. Know its limits before you rely on a clean result:
- Attributes are not checked for valid names, values or duplicates, and duplicate
idvalues are not reported. - Allowed nesting is not checked, so a
<div>inside a<p>is not flagged as long as both are closed. - Optional closing tags such as
</li>and</p>are expected, even though HTML allows you to leave them out. - Comments and script contents are scanned like ordinary markup, so tags written inside an HTML comment or a JavaScript string are counted too.
For a formal check against the HTML standard, run the page through the W3C Nu HTML Checker as well. Use this tool for the fast first pass while you edit.
A quick routine for templates and emails
- Paste or open the file. The tool accepts pasted code or an .html or .htm file.
- Validate and fix the first reported line.
- Repeat until the result shows that tags are balanced and nested correctly.
- Tidy the layout with the HTML formatter. Indentation makes any remaining nesting mistakes easy to see.
The check runs in your browser and the pasted HTML is not sent to ToolJiffy. For other file types, use the CSS formatter or the XML formatter.
Frequently Asked Questions
What does this HTML validator check?
It reads every tag in order and reports four problems with their line numbers: a closing tag that does not match the element it closes, a closing tag with no opening tag, an element that is never closed, and an <img> without an alt attribute.
Is it the same as the W3C Nu validator?
No. The W3C validator checks the full HTML specification, including attributes, allowed nesting and duplicate IDs. This tool is a quick structure check for tag balance and nesting. Use both when a page must pass formal validation.
Why does it report a <p> or <li> as never closed when browsers accept it?
HTML lets you leave out some closing tags, such as </p>, </li> and </td>. This checker expects every non-void element to be closed, so it reports them. Adding the closing tags makes the structure clearer and silences the report.
Which elements do not need a closing tag?
Void elements: area, base, br, col, embed, hr, img, input, link, meta, source, track and wbr. A tag ending in /> is also treated as closed.
Why do I see several errors from one mistake?
One missing closing tag shifts every later match. Fix the first reported line, validate again and repeat. The list usually shrinks quickly.
Can I validate fragments as well as full pages?
Yes. Paste a component, an email template block or a complete page, or open an .html or .htm file. A fragment does not need a doctype, html, head or body element.
Is my HTML uploaded?
No. The check runs in your browser with JavaScript, and the pasted HTML is not sent to ToolJiffy. The page itself still loads ordinary site resources, analytics and ads.