Doctype Checker
Recent Submissions
Doctype Checker: Verify Standards Mode Rendering
The doctype declaration is the very first line of an HTML document. This tool checks whether a page includes one.
What the Doctype Does
The doctype tells the browser which rendering mode to use. The modern declaration, <!DOCTYPE html>, triggers standards mode, in which browsers follow current CSS and HTML specifications. Without a valid doctype, browsers may fall back to quirks mode, which emulates older rendering behavior and can cause layouts to break in unexpected ways.
Quirks Mode vs. Standards Mode
- Standards mode: the browser follows modern specifications for box sizing, layout, and CSS behavior.
- Quirks mode: the browser mimics legacy behavior, which can change how widths, heights, and margins are calculated.
- Almost standards mode: a middle state triggered by certain older doctypes, with a few quirks retained.
Differences between modes can be subtle, such as how table cell heights or inline element spacing are handled, but they can also cause significant layout shifts.
Common Problems
- Missing doctype entirely.
- Older, verbose doctypes that trigger almost standards mode.
- Content or whitespace placed before the doctype, which can affect rendering.
- Doctype present but with typos that invalidate it.
Practical Uses
- Checking a legacy page for quirks mode.
- Auditing a template before a redesign.
- Diagnosing inconsistent layout behavior between browsers.
- Verifying a new page uses the modern doctype.
Limitations
The doctype controls rendering mode, not validity. A page with a correct doctype can still contain invalid markup, and a page in standards mode can still have layout problems. Use the doctype check as one part of a broader markup review.
Summary
The doctype determines whether a browser renders a page in standards or quirks mode. This checker confirms whether one is present, helping you avoid the inconsistent layouts that quirks mode can cause.
Similar Tools
Detect outdated HTML tags that should be replaced with modern equivalents.
Get the HTML lang attribute from a webpage.
Check whether a page declares its character encoding.
Popular Tools
Check whether a page is blocked from search engine indexing by meta robots tags, X-Robots-Tag headers, or robots.txt rules.
Measure the total download size of a webpage to identify performance and optimization opportunities.
Compare visible text to underlying code to assess content density.
Check whether images on a page use lazy loading to improve load performance.