Doctype Test
The Doctype Declaration Test verifies that the very first line of your HTML is <!DOCTYPE html> — the modern HTML5 doctype that triggers standards mode in every browser.
- Results in seconds
- Pass / fail + fix guidance
- No account required
The Doctype Declaration Test verifies that the very first line of your HTML is <!DOCTYPE html> — the modern HTML5 doctype that triggers standards mode in every browser. Missing or wrong doctypes silently switch the browser into quirks mode, where rendering, layout and JavaScript APIs behave inconsistently. The fix is one line of HTML; the impact is consistent rendering across every browser, ever.
What This Tool Checks
- Presence of <!DOCTYPE html> as the first content
- Doctype version (HTML5 vs HTML4 vs XHTML)
- Standards mode vs quirks mode trigger
- BOM or whitespace before the doctype
- Doctype casing variations
Why It Matters for SEO
Quirks mode is the legacy rendering mode browsers use for pages without a valid doctype. It produces inconsistent layouts, breaks modern CSS features (box-sizing, flexbox edge cases, viewport units) and disables some JavaScript APIs. Triggering standards mode with <!DOCTYPE html> at the top of every page is mandatory for predictable rendering.
How to Fix It
Make the first line of every HTML response exactly <!DOCTYPE html> with no preceding whitespace, BOM or content. Save HTML files as UTF-8 without BOM. Audit CMS templates and remove any pre-doctype injection.
How It Works
We fetch the URL's HTML and inspect the first non-whitespace bytes. The doctype declaration must come before any other content (no whitespace, no BOM, no comments) to trigger standards mode reliably.
Common Mistakes to Avoid
- Missing doctype entirely (triggers quirks mode)
- BOM bytes before <!DOCTYPE> pushing it out of position
- Old XHTML doctype declarations on modern HTML5 pages
- CMS injecting whitespace or comments before the doctype
- Conditional comments around the doctype for legacy IE
Quick Checklist
- <!DOCTYPE html> on the first line of every page
- No BOM or whitespace before the doctype
- Standards mode triggered in DevTools
- No legacy XHTML doctypes in production
- CMS templates audited for clean output
Put your whole site on autopilot — SEO and AI search
PositionMySite monitors every signal on this page across your entire website 24/7 — plus keyword rankings, competitor moves and AI-search readiness (llms.txt, schema, ChatGPT & Gemini visibility). When something breaks, you know before Google does.
Every feature unlocked · No commitment · Cancel anytimeFrequently Asked Questions
It tells the browser which HTML version and rendering mode to use. <!DOCTYPE html> triggers standards mode in every modern browser, ensuring predictable rendering.
A legacy rendering mode browsers use for pages without a valid doctype. It mimics 1990s browser behaviour and breaks modern CSS and JS APIs in subtle ways.
No. Always use the short HTML5 doctype: <!DOCTYPE html>. It works in every browser since Internet Explorer 6 and is the spec-recommended form.
Not directly. But quirks mode often causes layout and accessibility issues that hurt user experience and indirectly affect ranking signals.
Open DevTools and run document.compatMode in the console. "CSS1Compat" means standards mode; "BackCompat" means quirks mode.