HTML <!DOCTYPE> tag

Last Updated on May 11, 2023 by Roshan Parihar

HTML doctype tag is used to specify the type of the document. This tag must include the before <html> tag to show document type declaration.

Test it Live

Output

This is the document content.

The <!DOCTYPE> tag does not contain any content and does not have any closing tag. The HTML doctype declaration confirms to the browsers that the document should be rendered as HTML.

Tip: Always consider adding a declaration to HTML documents to help the browser recognize the document type.

The syntax of the HTML !DOCTYPE tag in HTML 5 is given below:

Syntax
<!DOCTYPE html>

The above syntax shows that is HTML 5 document and should be executed as HTML. It has no closing tag in the HTML document. HTML 5 document declaration is standard and simple with this tag.

Note: DOCTYPE declaration is not case sensitive.

Specifications of HTML <!DOCTYPE> Tag:

Start Tag <!DOCTYPE>
End Tag N/A
Content N/A

Supported Browsers

  • Google Chrome
  • Microsoft Edge
  • Internet Explorer
  • Safari
  • Firefox
  • Opera