What is the HTML5 doctype declaration?
Answer
<!DOCTYPE html>
Answer
<!DOCTYPE html>
The HTML5 doctype declaration is `<!DOCTYPE html>`.
Placed at the beginning of an HTML document, this short declaration tells browsers to use standards mode for rendering. HTML5 deliberately simplified the doctype because HTML5 does not rely on a traditional document type definition, or DTD, for ordinary `text/html` parsing.
Earlier HTML and XHTML versions commonly used much longer declarations containing public identifiers and URLs, such as the HTML 4.01 Strict doctype. Modern browsers do not fetch those DTDs to render HTML pages, but older declarations remain important for historical validation and compatibility.
The HTML5 doctype is case-insensitive when the document is served as HTML, so `<!DOCTYPE HTML>` is also valid in practice. The stored form is the conventional canonical spelling. Omitting the declaration can trigger quirks mode, in which browsers imitate older layout behavior and CSS sizing may produce surprising results.
Source: Wikipedia · fact-checked Aug. 2026