Back to Terminology

Doctype

January 29, 2023

The doctype, or document type declaration, is a line of code placed at the top of an HTML or XML document before the opening <html> tag. The doctype is used to specify the version of HTML or XML in which the document is written and to inform the web browser how to interpret and render the document.

In HTML, the doctype is used to specify the version of HTML that the document is written in.

The most commonly used doctype for HTML5 is:

This doctype is called an “HTML5 doctype,” and all modern web browsers support it. Using this doctype triggers the browser to render the webpage in “Standards mode,” which means that the browser will interpret the HTML and CSS code according to the World Wide Web Consortium (W3C) standards.

In XML, the doctype is used to specify the version of XML that the document is written in and to provide a link to the DTD (Document Type Definition) that defines the structure and elements of the document.

In summary, The doctype, or document type declaration, is a line of code placed at the top of an HTML or XML document before the opening <html> tag. The doctype specifies the version of HTML or XML in which the document is written and informs the web browser how to interpret and render the document. In HTML, the doctype is used to specify the version of HTML the document is written in; the most commonly used doctype for HTML5 is <! DOCTYPE HTML>, which triggers the browser to render the webpage in “Standards mode” according to the standards set by the World Wide Web Consortium (W3C). In XML, the doctype is used to specify the version of XML that the document is written in and to provide a link to the DTD (Document Type Definition) that defines the structure and elements of the document.

Also, See: Document Type Definition (DTD)

Guaranteed Customer Satisfaction

We Promise. We Innovate.

Do you have an idea? Our experts are there to transform it into a recognized brand. We help you innovate your business with best-in-class solutions.
  • We will respond to you within 24 hours.
  • We’ll sign an NDA if requested.
  • You'll be talking to product and tech experts (no account managers).