HTML Validator (nesting and tags)

Paste HTML and find the structural mistakes browsers hide: tags left open, closed in the wrong order or never opened, duplicate ids, obsolete tags and common accessibility slips.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Paste HTML

    Paste the page or fragment.

  2. 2
    Read errors

    Start with unclosed and misnested tags.

  3. 3
    Check warnings

    Fix duplicate ids, alt text and obsolete tags.

  4. 4
    Fix the source

    Edit the template or file.

  5. 5
    Re-check

    Paste the corrected HTML.

  6. 6
    Validate fully

    Run the W3C checker for final conformance.

About this tool

Browsers are forgiving: they silently close tags you forgot and rearrange tags you closed in the wrong order. The page looks fine in one browser, but the DOM is not what you wrote, so CSS selectors miss, JavaScript finds the wrong element, and screen readers read things in an odd order. This checker reads your HTML like a parser and reports the structural problems with their line and column: elements that are never closed, elements closed in the wrong order, closing tags with no matching opening tag, void elements such as br or img given a closing tag, and self-closing syntax used on elements that HTML does not allow to self-close. It also catches duplicate id values, duplicate attributes, obsolete elements like center and font, images without alt text, a missing lang attribute or title, and target=_blank links without rel=noopener. Elements with optional end tags, such as p and li, are closed automatically exactly as HTML parsers do, so valid shorthand is not flagged.

Errors

- Never closed: a div, span or section left open until the end. - Not closed before: an element still open when its parent closes, such as b inside p closed after the p. - No matching opening tag: a stray closing tag. - Duplicate id or attribute: ids must be unique on a page, and an attribute may appear once per element. - Script or style never closed, which swallows the rest of the page.

Warnings

- Missing doctype (the page runs in quirks mode), missing lang on html, missing title. - Images without alt text. - Obsolete elements such as center, font, marquee, big and tt. - Closing tags on br or img: void elements have no closing tag. - Self-closing slash syntax on a normal element such as div, which HTML treats as an opening tag. - target="_blank" without rel="noopener".

Optional end tags

HTML lets you leave out the end tags of p, li, dt, dd, option, tr, td, th and a few others, because the parser closes them automatically when the next block starts. The checker follows those rules, so it does not report valid shorthand.

Where structure matters

Templates and CMS content often produce broken nesting when fragments are combined. Run the rendered HTML through the checker, not just the template.

Limits

This checks structure and common mistakes, not every rule of the HTML standard (such as which elements may appear inside which, or attribute value formats). For full conformance, use the W3C Nu HTML Checker. It is a quick development aid, not an accessibility audit.

Worked example

A page where a b element is closed after its p, an img has no alt, two divs share id="main", a center element is used and a span is never closed gives errors on lines 6 and 12 and warnings for the image, duplicate id, obsolete tag and missing lang.

Quick facts

Frequently asked questions

Does it follow browser parsing rules?

For optional end tags, yes; elements like p and li close automatically as in browsers.

Will it fix my HTML?

No. It lists each problem with its line so you can fix it.

Does it check accessibility?

Only basics such as alt text and lang; use an accessibility checker for more.

Can it check a live URL?

Paste the page source; browsers do not let pages fetch other sites' HTML.

Is my code uploaded?

No. Checking runs in your browser.

Is it as strict as the W3C validator?

No. It focuses on structure and common errors; the W3C Nu checker covers the full standard.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages