Skip to content

HTML Validator

Short answer

Check the document basics (doctype, language, charset, viewport, title, unique IDs), obsolete HTML tags and attributes, and how iframes are embedded.

What it does not do: It is a quick check of the basics, obsolete markup and iframes, not a full validator for the HTML standard, and it reads the raw source, not the page after JavaScript runs.

Free · No signup · Runs in your browser
100% in your browser — your content never leaves your device.

What It Does

Checks a page's HTML in three parts. Document basics: a DOCTYPE, a `lang` attribute, a charset declaration, a viewport meta tag, a `<title>` and unique `id` values. Obsolete HTML: tags such as `<center>`, `<font>` and `<marquee>`, and presentational attributes such as `align` and `bgcolor`. Embedded frames: whether each iframe has a title, loads lazily when offscreen, is sandboxed when it comes from another site and uses HTTPS. Each part lists what it found.

Why It Matters

Browsers repair broken markup silently, but assistive technology and crawlers work from whatever the parser produces. A missing `lang` or viewport tag, duplicate IDs, presentational leftovers and untitled iframes are small, fixable problems that affect accessibility, mobile rendering and how reliably the page is read.

How It Works

  1. Enter a page URL or paste its HTML

  2. We parse the raw HTML in your browser

  3. Run the document-basics, obsolete-HTML and iframe checks

  4. Return a result for each part, with the duplicate IDs, obsolete elements and iframes we found

Sample input + output

INPUT
url: https://rankproof.eu/tools
OUTPUT
Document basics                              100/100
  Duplicate IDs: 0 · Structural issues: 0 · Elements: 622
  HTML5 doctype declared                     OK
  html lang attribute set                    OK
  Character encoding declared                OK
  Viewport meta present                      OK
  Title element present                      OK
  No duplicate IDs                           OK

Obsolete HTML                                100/100
  Deprecated tags: 0 · Deprecated attributes: 0
  No obsolete tags                           OK
  No obsolete attributes                     OK

Embedded frames (iframes)                    100/100
  No iframes found.

3 of 3 areas look good · 100/100

How to read the result

Three parts (3 of 3 areas look good · 100/100)
Document basics, obsolete HTML and embedded frames each get their own score. The overall score is their average, and the summary counts the parts with nothing to fix, so one weak part keeps it from turning green even when the average looks high.
Document basics
Six checks on the raw HTML: a <!doctype html> line, a lang attribute on <html>, a charset declaration, a viewport meta tag, a non-empty <title> and id values used only once. A missing viewport is a warning; each of the others fails and costs the part 16 points. "Elements" (622 in the sample) is how many elements the parser found; it gives context and is not scored.
Duplicate IDs (0)
How many id values appear more than once; the report lists each one as #id. Labels, aria-labelledby, in-page links and scripts find an element by its id, so a duplicate makes them point at the wrong element. Duplicates often come from a component repeated on the page, such as a search box in both the header and the footer.
Obsolete HTML (0 tags · 0 attributes)
Counts tags such as <center>, <font>, <marquee> and <big>, and presentational attributes such as align, bgcolor, border and cellpadding on any element. Every occurrence counts, so one old table can add a dozen; the report lists each name with how often it appears. Tags cost more points than attributes.
Embedded frames (no iframes found)
With no iframes there is nothing to check, so the part scores 100, as in the sample. With frames, it checks a title on each, that at least one of several frames loads lazily, a sandbox attribute on frames from other sites and that every source is https:// or on the same site. For pasted HTML we do not know the page's own address, so every absolute iframe address counts as another site.

Who Uses This

  • Frontend Developer

    Check a preview build before merging and fix duplicate IDs or missing meta tags before they ship.

  • QA Engineer

    Add the check to your release checklist to catch markup that a CMS template change broke.

  • Accessibility Auditor

    Clear up untitled iframes, a missing lang attribute and duplicate IDs before starting a full WCAG review.

Common problems and how to fix them

  1. No doctype, lang, charset or viewport

    Put <!doctype html> on the first line, set lang on <html> to the page's language, declare the charset within the first 1024 bytes and add the viewport meta tag. They belong in the base template, so one change fixes every page.

    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>Running Shoes and Trail Shoes | Example Shop</title>
  2. Duplicate IDs

    Give each element its own id, or remove ids nothing uses. For a component repeated on one page, build the id from a prefix and the instance, and update every for, aria-labelledby, aria-controls and href="#…" that points to it.

    <label for="search-header">Search</label>
    <input id="search-header" type="search" name="q">
    
    <label for="search-footer">Search</label>
    <input id="search-footer" type="search" name="q">
  3. Obsolete tags and attributes

    Move the presentation into CSS: text-align instead of align and <center>, background-color instead of bgcolor, border and padding on table cells instead of border and cellpadding, font properties instead of <font>. Content pasted from a word processor or an old editor is the usual source.

    <!-- before -->
    <center><font color="#b91c1c" size="4">Sale</font></center>
    <table border="1" cellpadding="8">
    
    <!-- after -->
    <p class="notice">Sale</p>
    <table class="data">
    
    /* stylesheet */
    .notice { text-align: center; color: #b91c1c; font-size: 1.25rem; }
    .data td, .data th { border: 1px solid #cbd5e1; padding: 8px; }
  4. An iframe without a title, or every frame loading at once

    Give each frame a title that says what it contains; embed codes often carry a generic one such as "video player", which tells a screen-reader user nothing. Add loading="lazy" to frames below the first screen, so the browser fetches them only as the visitor scrolls near.

    <iframe src="https://video.example/embed/123"
      title="Video: how to set up the plugin"
      width="560" height="315" loading="lazy"
      allow="fullscreen; picture-in-picture"></iframe>
  5. A frame from another site without sandbox

    An empty sandbox attribute switches off scripts, forms, pop-ups and navigation inside the frame; add back only what the embed needs, then test it. Never combine allow-scripts with allow-same-origin on a frame from your own site: the framed page could then remove the sandbox.

    <iframe src="https://maps.example/embed?q=Athens"
      title="Map of our Athens office"
      sandbox="allow-scripts allow-same-origin allow-popups"
      width="600" height="400" loading="lazy"></iframe>
  6. A frame loaded over http://

    Change the address to https://. A secure page blocks plain-HTTP frames as mixed content, so the frame stays empty. If the provider offers no HTTPS version, link to it instead of embedding it.

Frequently Asked Questions

Are HTML errors a ranking factor?
Not directly — Google has said valid HTML is not a ranking factor. Broken markup can still cause indirect problems, such as structured data or content that is not read the way you intended.
What counts as obsolete HTML?
Elements and attributes the HTML standard no longer supports for presentation, such as `<center>`, `<font>`, `<marquee>`, `<big>`, `<strike>`, `align`, `bgcolor` and `border`. Replace them with CSS.
Why do iframes need a title?
Screen readers announce the title so people know what a frame contains before they enter it. It is part of giving every frame an accessible name under WCAG 2.1.
Does it validate JavaScript-rendered content?
No — we check the raw HTML source, either pasted or fetched directly, not the DOM after JavaScript runs.
Does it check every HTML rule?
No — it is a fast check of the basics, obsolete markup and iframes, not a full validator for the HTML standard.

Sources

The documentation this tool and the explanations on this page are based on.