Check / locate / fix

HTML Validator Online

Paste HTML or open a file to find unclosed and stray tags, duplicate IDs, images without alt text, labels that point nowhere and missing document basics. Every result shows its line and column, and selecting it highlights the code. The check runs in your browser.

Line and column for each issueStructure and accessibility checksNothing is uploaded
Try it here

Check your HTML

Paste a complete page or a fragment and select Check HTML. Results are listed in source order; fix the first error first, because one missing tag can cause several later messages.

This checker covers the mistakes that most often break hand-written pages. It is not a full conformance validator: before publishing, also run the page through the W3C Nu Html Checker at validator.w3.org/nu for a complete check against the HTML standard.

HCODX / check results

    What it checks

    What the HTML checker looks for

    A rendering check answers whether the page looks right. A markup check asks whether the document says what you meant, before the browser quietly repairs it.

    The checker reads your markup the way a browser's parser does, including the end tags HTML lets you leave out, such as those for li, p and td. It reports what a browser would have to repair: elements that are never closed, closing tags with no matching element, tags closed in the wrong order, void elements such as br written with a closing tag, a paragraph that ends early because a block element was placed inside it, and links or buttons nested inside each other.

    It also reports problems that leave the page looking normal but break behavior or accessibility: duplicate id values, label and aria-labelledby references to ids that do not exist, form fields with no label, images with no alt attribute, empty links and buttons, and in-page links to missing anchors. For a complete document it checks the doctype, the lang attribute, the character encoding, the title and the viewport meta tag.

    Valid syntax is not the whole of quality. A checker cannot tell whether the text is helpful, the color contrast is sufficient, the keyboard order makes sense or an image's alt text is meaningful. It also does not earn a search ranking boost on its own. Use it as one precise part of accessibility and content review, not as an SEO score.

    Correct the document tree

    Improper nesting makes the parser close or move elements, so the DOM differs from what your indentation suggests.

    Keep identifiers unique

    Duplicate IDs make fragment links, labels and JavaScript selectors ambiguous. Give each target a distinct value.

    Verify relationships

    Labels, controls and ARIA references depend on exact values. A label that sits beside a field is not necessarily connected to it.

    Reading the results

    Errors, warnings and notes

    Each result has a severity, a position and a plain-language explanation.

    01

    Errors

    The browser has to repair the markup, or a feature such as a label, link or image description cannot work. Fix these first, starting from the top.

    02

    Warnings

    Allowed by the parser but likely to cause trouble: a form field without a label, a missing lang attribute, an obsolete element or a link to an anchor that does not exist.

    03

    Notes

    Advice that needs judgment, such as a heading level that jumps from h2 to h4 or an iframe without a title. Decide case by case.

    Select any result to highlight the exact spot in your code, fix it in place, and run the check again.

    Before publishing

    A four-pass HTML review

    Fix structure first, then relationships, then check the rendered result again.

    Start with a complete document Check the doctype, html lang, character encoding, title and body. Fragments can be checked too, but a full page needs its document metadata.
    Inspect nesting Look for crossed closing tags, block elements inside paragraphs and list items outside a list. Formatting the file first makes these easier to see.
    Check IDs and references Make every id unique, and confirm that label for values, ARIA references and #fragment links point to an existing element.
    Review meaning and behavior Ensure links navigate, buttons act, images have suitable text alternatives and headings describe sections. Test with a keyboard as well.

    A label that points to the wrong id still looks fine on screen

    <!-- Broken: the label points to an ID that does not exist -->
    <label for="email-address">Email</label>
    <input id="email" type="email">
    
    <!-- Fixed: the values match -->
    <label for="email">Email</label>
    <input id="email" type="email">

    In the broken version the page looks normal. Matching for and id makes clicking the label focus the field and gives assistive technology an explicit association.

    Example

    A duplicate id can break a label while the page still looks normal

    An id must identify one element in the document. Repeating it makes relationships and fragment targets ambiguous.

    Consider two fields that both use id="email". A label for="email" is associated with the first matching control, even when it sits directly beside the second. A screenshot will not reveal which field receives focus when the label is selected.

    Paste the first block into the checker above: it reports the duplicate id with the line where the value was first used. Give each control a unique id, update every for attribute and fragment link, then click each label and move through the form with the keyboard.

    Duplicate and distinct IDs
    <!-- Ambiguous: two controls share one id -->
    <label for="email">Work email</label><input id="email" type="email">
    <label for="email">Backup email</label><input id="email" type="email">
    
    <!-- Distinct associations -->
    <label for="work-email">Work email</label><input id="work-email" type="email">
    <label for="backup-email">Backup email</label><input id="backup-email" type="email">
    Scope

    Markup validity, accessibility and SEO are related, not identical

    A precise diagnosis prevents overpromising what a checker can do.

    Compare

    HTML conformance

    A validator identifies markup that breaks HTML rules or has suspicious structure. It is most useful when browser error recovery hides a nesting problem.

    Compare

    Accessibility

    Some issues overlap, such as missing label associations and alt attributes, but focus order, contrast and meaningful alternatives need human and assistive-technology testing.

    Compare

    Search quality

    Search engines parse imperfect HTML well. Accurate titles, useful original content and crawlable links matter far more than a clean report.

    Questions

    HTML validation without myths

    No. The checks run in JavaScript inside this page. Your code is not uploaded to HCODX or anyone else, and nothing is saved when you leave.

    No. The W3C Nu Html Checker tests a document against the full HTML standard. This checker focuses on a smaller set of common, high-impact mistakes and explains each one in plain language. Use both: this one while you work, the W3C checker before you publish.

    Browsers recover from many markup errors. The visible result can conceal a changed DOM tree, duplicate IDs or a missing label association that affects keyboard and screen-reader users.

    No. Conformance catches some structural problems but cannot judge every interaction, color choice, reading order or text alternative. Test those separately.

    No automatic penalty follows from a single markup diagnostic. Serious structural errors can interfere with parsing or with users, but search visibility depends on much more than syntax.

    The parser has to recover from the first structural mistake, and later elements can end up in the wrong place. Correct the earliest genuine error, then run the check again.

    It can flag a missing alt attribute, but usefulness depends on the image's role and the surrounding text. A human content and accessibility review is still needed.

    Both work. Document checks for the doctype, title, encoding and lang only run when your input contains a doctype or html, head or body tags, so a component can be checked on its own without those warnings.

    Fix structure before polishing pixels

    Open the editor to work on the full project, then check the corrected result in its live preview.

    Instant HTML Runner & Viewer with Live Preview

    Need to run a short HTML, CSS and JavaScript snippet? The HTML Runner Online has a focused editing surface with live output.

    Open HTML Runner Online