What This HTML Validator Checks

This HTML Validator retrieves the live HTML document of a public URL over HTTP/HTTPS (following up to 5 redirects and verifying the response Content-Type) and performs a comprehensive syntax, DOM tree structure, and accessibility audit against W3C HTML5 and WCAG rules.

Instead of only checking basic tag closure, the audit inspects the full document structure and reports exact line numbers, column positions, and the offending HTML code extract for each issue found:

  • Document foundation and metadata: Verifies the presence of a valid <!DOCTYPE html> preamble, character encoding declaration (<meta charset="UTF-8">), document language attribute on the root element (<html lang="...">), and required <title> element inside <head>.
  • Tag closure and DOM nesting rules: Detects unclosed elements, stray start or end tags, mismatched opening and closing tags, and forbidden parent-child combinations—such as placing a <button> inside an <a> link, nesting an <a> element inside another <a>, placing block-level elements inside inline containers, or inserting <style> tags directly inside <body>.
  • Attribute syntax and ID uniqueness: Scans the entire DOM (excluding script and style blocks) for duplicate id values, duplicate attributes on the same tag, unquoted attribute values, invalid attribute values for specific elements, and trailing slashes on void elements (such as <meta /> or <img />) that can interact poorly with unquoted attributes.
  • Obsolete and unnecessary markup: Identifies deprecated HTML4 tags (<center>, <font>, <marquee>, <blink>, <big>, <strike>, <tt>, <applet>, <frameset>, <frame>), obsolete attributes (such as name on anchors or legacy charset on meta tags), and redundant type="text/javascript" or type="text/css" attributes.
  • Accessibility (WCAG / ARIA) and heading outline: Checks for missing alt attributes on <img> tags, missing title attributes on <iframe> elements, empty headings (<h1>–<h6>), skipped heading levels (for example, jumping from <h1> directly to <h3>), <section> or <article> containers lacking headings, and unnecessary ARIA roles on native semantic elements.

Understanding Errors, Warnings, and Info Notices

After scanning a URL, the tool groups all findings into three severity counters so you can prioritize fixes systematically:

  • Errors (Red): Direct violations of the WHATWG / W3C HTML5 specification. Examples include unclosed tags, duplicate id attributes, missing alt attributes on content images, invalid element nesting, or missing <title> tags. These issues can cause inconsistent DOM trees across browsers, break JavaScript selectors, or block screen readers.
  • Warnings (Yellow): Structural or accessibility weaknesses that do not break HTML parsing outright but go against best practices. Examples include missing lang attributes on <html>, empty heading elements, sections without headings, or unnecessary type attributes on scripts and stylesheets.
  • Info (Blue): Informational parser notes regarding document structure, optional syntax cleanup, or serialization details (such as trailing slashes on void elements or XML comment formatting).

Why Valid HTML Matters for Browsers, SEO, and Accessibility

Modern web browsers (Chrome, Firefox, Safari, Edge) include error-recovery routines that attempt to repair broken markup when building the Document Object Model (DOM). However, relying on browser error recovery introduces real technical risks:

  1. Cross-browser rendering consistency and performance: When a page omits a valid <!DOCTYPE html> or leaves container tags unclosed, browsers may fall back to Quirks Mode or reconstruct the DOM tree differently. Fixing unclosed tags and invalid nesting prevents unexpected layout shifts on mobile viewports and avoids extra DOM recalculation cycles during page load.
  2. JavaScript stability: Functions such as document.getElementById() assume that every id attribute in a document is unique. When multiple elements share the same id, scripts only target the first matching node, which often breaks interactive menus, modals, or form validation.
  3. Search engine crawling and indexing: Search engine crawlers read raw HTML and rendered DOM structures to extract page titles, canonical links, heading hierarchies (H1–H6), and internal links. If a <head> section contains invalid body elements (such as an unclosed tag or stray <div>), crawlers may prematurely close the <head> tag and ignore subsequent meta tags, canonical URLs, or hreflang declarations.
  4. Assistive technology and WCAG compliance: Screen readers (NVDA, JAWS, VoiceOver) rely on valid semantic landmarks, proper heading order, explicit <html lang> declarations for speech synthesis pronunciation, alt descriptions on images, and non-nested interactive controls (never placing a button inside a link).

How to Use the Tool

Enter the full public address of the webpage you want to inspect (for example, https://example.com/page) and click Analyze HTML. The server fetches the live HTML source (up to 2 MB, with local and private IP ranges blocked for security), runs the W3C HTML5 and accessibility checks, and displays the summary counters along with up to 250 detailed issue cards showing the exact line number, column number, and code snippet.