HTML Validator
Check HTML for structural, semantic, and common accessibility issues directly in your browser.
How to validate HTML
- Paste HTML in the input panel.
- Click Validate HTML.
- Review the summary and issue list.
What this validator checks
- Document structure and metadata.
- Unique IDs.
- Image alt attributes.
- Form control labeling.
- Button type.
- Obsolete elements and attributes.
Errors vs. warnings
Errors are structural problems. Warnings are high-confidence issues that are not universally invalid.
What this validator does not check
- Content-model validation.
- CSS, JavaScript, SVG, MathML content.
- Source-level issues the parser normalizes.
- Full WCAG conformance.
When HTML validation is useful
Validation is a quick way to catch problems before they cause harder-to-diagnose bugs: tracking down why a layout breaks in one browser but not another, checking a page's markup before it goes live, or reviewing a template for the kind of structural and labeling issues that also affect accessibility and standards compliance.
Common errors this validator flags
- Unclosed elements - an opening tag with no corresponding closing tag.
- Mismatched elements - a closing tag that doesn't match the most recently opened element.
- Invalid nesting - an element placed somewhere the HTML content model doesn't allow, such as a block element inside a paragraph.
- Duplicate or incorrect attributes - the same ID used twice on a page, or an attribute value that doesn't match what the attribute expects.
Syntax validation vs. browser rendering
A browser's HTML parser is built to recover from broken markup and still produce a usable page, silently closing tags, reordering misplaced elements, or ignoring a duplicate attribute rather than failing outright. That means a page can look and behave correctly in every browser you test while its underlying markup is still technically invalid - validation surfaces that gap so it can be fixed at the source instead of relying on parser recovery.
Frequently asked questions
- Does this validator upload my HTML?
- No. Parsing and validation run entirely in your browser.
- Is this a complete HTML validator?
- No. It runs a focused set of high-confidence rules.
- Why can a page render fine but still show validation errors?
- Browsers are built to display something useful even from broken markup - closing an unclosed tag, moving misplaced elements, or dropping a duplicate attribute automatically. Validation checks the markup you actually wrote, not the corrected version the browser silently constructs.
- What's the difference between an unclosed and a mismatched element?
- An unclosed element is missing its closing tag entirely, so the browser has to guess where it ends. A mismatched element has a closing tag, but it doesn't correspond to the most recently opened element, which is usually a sign a tag was closed in the wrong order.
- Should I validate before or after deploying a page?
- Before, ideally. Catching invalid nesting, duplicate IDs, or missing alt attributes while a page is still in development is much cheaper than finding them after the page is live, especially since some of these issues also affect accessibility and search indexing.