Doctype checker
Check whether a webpage has an HTML doctype declaration and review its value.
Latest submissions
What the doctype checker does
This tool checks whether a webpage includes a doctype declaration and reports its value. The doctype is the first line of an HTML document, before the html element, and tells the browser which rendering mode to use.
Modern pages use the short HTML5 declaration: <!DOCTYPE html>. Older documents may use longer declarations with version identifiers and DTD references. The exact form matters because browsers use it to decide between standards mode and quirks mode.
Why the doctype matters
Standards mode renders the page according to modern CSS and layout rules. Quirks mode, triggered by a missing or legacy doctype, emulates older browser behavior for backward compatibility. In quirks mode, box sizing, line heights, and other layout calculations can differ from what you expect, causing subtle and confusing bugs.
A correct doctype is a basic hygiene item. It helps ensure consistent rendering across browsers and avoids legacy emulation that makes debugging harder. It is also required for valid HTML, and validation tools often flag a missing doctype.
How to interpret the result
If the doctype is present and is <!DOCTYPE html>, the page is in standards mode. That is the expected state for modern documents. If a legacy doctype is reported, the page may still render in standards mode depending on its form, but updating to the HTML5 declaration is usually appropriate.
If no doctype is found, the browser may enter quirks mode. That is a clear signal to add the HTML5 declaration and then verify the layout, since pages built under quirks mode sometimes depend on its behavior without the authors realizing it.
Common doctype issues
- Missing doctype. The document may render in quirks mode.
- Legacy doctype. Old declarations can trigger transitional or quirks behavior.
- Content before the doctype. Comments or whitespace before the declaration can affect parsing.
- Typos. Malformed declarations may not be recognized.
Practical workflow
Check the doctype on key templates. If it is missing, add it as the very first line and test the layout after the change, because fixing quirks mode can reveal previously hidden CSS issues. Keep the declaration consistent across generated and static pages.
Limitations
The checker reports the doctype found in the HTML response. It does not directly test the rendering mode or assess visual differences that may result from changing the declaration.
Similar tools
Detect outdated HTML tags on a webpage and see which modern alternatives should replace them.
Get the HTML language attribute of a webpage and see how its language is declared.
Check whether a webpage declares its character encoding and which encoding it uses.
Popular tools
Check whether images on a webpage have alt attributes for accessibility and image SEO.
Measure the total size of a webpage, including all loaded resources.
Check whether a page is set to noindex through meta tags, HTTP headers, or robots.txt.
Compare the amount of visible text to HTML code on a webpage.