Skip to main content

How to fix: HTML DOCTYPE declaration is missing

The page does not start with a DOCTYPE declaration, triggering quirks mode in some browsers.

Why it matters

Without a DOCTYPE, browsers may render the page in quirks mode, a legacy compatibility mode with different CSS box model behavior, inconsistent XSS filtering (in old browsers), and unpredictable rendering that can break security UI elements.

Every HTML page must start with <!DOCTYPE html>.

How to fix it

  1. 1Add <!DOCTYPE html> as the very first line of every HTML document

Code examples

Correct DOCTYPE

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>Page Title</title>
</head>

References

Detected automatically by VulnRadar. The check id is doctype-missing, stable across every scan so you can filter or diff on it.

See every headers check

Questions

How severe is HTML DOCTYPE declaration is missing?
VulnRadar rates this low severity in the headers category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id doctype-missing, which stays the same between runs so you can filter, diff, or gate CI on it.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for html doctype declaration is missing

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: HTML DOCTYPE declaration is missing | VulnRadar