Яндекс.Метрика

Doctype checker

Check whether a webpage has an HTML doctype declaration and review its value.

0 of 0 ratings

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

Deprecated HTML tags checker

Detect outdated HTML tags on a webpage and see which modern alternatives should replace them.

2
Language attribute checker

Get the HTML language attribute of a webpage and see how its language is declared.

17
Meta charset checker

Check whether a webpage declares its character encoding and which encoding it uses.

2

Popular tools