HTML fundamentals / 03
DOCTYPE and DTD
Understand document type definitions, older HTML declarations, and the short HTML5 doctype.
On this page
What is a DTD?
A DTD, or Document Type Definition, defines the structure of a document. The term is associated with SGML-family markup and is used in contexts including SGML, older HTML versions, XHTML, and XML.
What is DOCTYPE?
HTML has had several versions, and older versions used different document definitions. A doctype declaration identifies the document type. For example, an HTML 4.01 Strict document used a long declaration referring to a DTD:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
HTML5 uses a much shorter declaration:
<!DOCTYPE html>
Editorial note: a doctype is a declaration, not a normal HTML element or a
metatag. In modern HTML, the short declaration helps browsers use standards mode; it does not refer to an HTML5 DTD. Spaces and a malformed link in the original examples have been repaired in the code above.
The original version timeline
| Version | Year listed in the original |
|---|---|
| HTML | 1991 |
| HTML+ | 1993 |
| HTML 2.0 | 1995 |
| HTML 3.2 | 1997 |
| HTML 4.01 | 1999 |
| XHTML | 2000 |
| HTML5 | 2012 |
The table is preserved as the article's historical overview. Its HTML5 date refers to the era of the specification's development, not its final 2014 W3C Recommendation. Today HTML is maintained as a living standard.
Moved here from Tistory
I migrated this post from my Korean Tistory blog, I am Jason Lee, to this website and translated it into English. My writing and projects now live together in one place.
The original publication date, code examples, and screenshots are preserved. Editorial notes clarify known issues in the original material.
Original post on Tistory English edition · Aug 30, 2026