HTML5 Doctype

The HTML5 DOCTYPE is surprisingly simple to remember and use.


In general DOCTYPE declarations tell the browser what version of HTML the page is written in. They are required and must be placed at the top of your document before the <html> or <head> tags. While previous versions of HTML had various DOCTYPE declarations, HTML5 has only one.


<!DOCTYPE html>

It's that easy.

Here's what it looks like as part of a basic page.

<!DOCTYPE html>
<title>DOCTYPE Example</title>
<h1>I'm an HTML5 Page</h1>


  • While often capitalized it's worth noting that the declaration is case insensitive.

Published: Aug 10th, 2019

Updated: Sep 1st, 2019