Developer Tools

HTML Validator

Find the mistakes in your markup before a browser has to guess what you meant. Paste a full page or a fragment, and the validator lists every problem with its line and column; select one to jump straight to it in the editor.

  • Runs in your browser
  • No sign-up
  • Free to use

How to use HTML Validator

  1. Paste your HTML or open an .html file.
  2. Choose whether to include accessibility checks and style conventions.
  3. Select Validate HTML.
  4. Work through the list: select an issue to highlight its line, fix it and validate again.

HTML Validator features

Structural errors

Unclosed and mismatched tags, duplicate attributes, duplicate IDs and empty src attributes.

Character escaping

Finds raw <, > and & characters that should be written as entities.

Obsolete and unknown elements

Flags elements removed from HTML5 and tags the browser does not recognise.

Accessibility checks

Missing alt text, missing lang attribute, form fields without labels, frames without titles.

Pages and fragments

Detects whether you pasted a whole document or a snippet and applies document rules only where they make sense.

Click to locate

Each issue shows line and column and jumps to the spot in the editor.

When to use HTML Validator

  • Checking a template or email layout before it goes live.
  • Finding the unclosed tag that breaks a page layout.
  • Reviewing HTML produced by a visual editor or a CMS plugin.
  • Teaching or learning correct markup with immediate feedback.

HTML Validator FAQ

Why validate HTML if browsers display it anyway?

Browsers repair invalid markup silently, and each repair is a guess. An unclosed tag may swallow the rest of the page into the wrong element, a duplicate ID breaks scripts and anchor links, and screen readers and search engines can interpret a broken structure differently from what you see. Valid markup behaves the same everywhere.

Is this the same as the W3C validator?

No. This tool checks the common, high-impact rules in your browser and works offline with private code. The W3C Markup Validation Service checks conformance to the complete HTML specification, including which elements may be nested in which. Use this for quick feedback and the W3C service for a formal check.

What is the difference between errors and warnings?

Errors are structural faults that can change how the page is built, such as mismatched tags or duplicate attributes. Warnings are things that work but should be improved: missing alt text, obsolete elements, unescaped characters that browsers happen to tolerate.

Can I validate a fragment instead of a whole page?

Yes. If the text contains no doctype or html element, it is treated as a fragment, and rules that only apply to complete documents, such as requiring a title, are skipped.

What do the style conventions check?

Lowercase tag and attribute names, double quotes around attribute values and tidy spacing. These are conventions, not requirements of HTML, so they are off by default.

Is my code uploaded?

No. Validation runs entirely in your browser. Nothing you paste leaves your device.

How browsers treat invalid HTML

HTML is forgiving by design. The specification defines exactly how a parser must recover from every kind of mistake, so a page with errors never fails to display. That forgiveness is also what makes mistakes expensive to find. The browser shows something, the author moves on, and the consequence appears later in a different place: a footer that inherits the wrong styles because a div was never closed, a script that attaches to the first of two elements sharing an ID, a form field that a screen reader announces without a name.

The most damaging errors are structural. When a closing tag is missing, the parser decides where the element ends, and its decision depends on the elements that follow. Change the content and the page may be assembled differently. Tag-pair checking catches these cases and reports the line where the mismatch becomes apparent, which is usually close to, though not always exactly at, the place where the tag was forgotten.

Other checks protect behaviour. IDs must be unique because labels, anchors, ARIA references and scripts all look elements up by ID and receive only the first match. Attributes may appear once per element; when one is repeated, the second is ignored without notice. Characters with special meaning in HTML need to be written as entities, or text such as “a < b” can be read as the start of a tag.

Accessibility rules are included because they are cheap to satisfy while writing and laborious to add later. An image without an alt attribute is announced by its file name. A page without a lang attribute may be read aloud with the wrong pronunciation. A form control without a label leaves a visitor guessing what to type.

Other useful tools