Live rework in progress.
Please report major issues.

Jens Oliver Meiert

The Most Minimal Valid HTML Document

Published on Oct 2, 2023 (updated Mar 31, 2025), filed under (feed). (Share this on Mastodon or Bluesky?)

—is still this:

<!DOCTYPE html><title>␣</title>

(“␣” is a placeholder, as the title element can’t be empty. The code represents the valid/required-only HTML writing style, leaving out everything that can be left out.)

Why “still”?

Because we’ve covered this many years ago, in 2008 (2014 gist, 2020 pen), though back then it was more about demonstrating universality and maximum reusability (contrasting heavily with templates like HTML5 Boilerplate) than promoting conformant minimalism.

Why repeat “this”?

Because of ChatGPT, which can’t yet optimize HTML:

“The most minimal valid HTML document consists of just two required elements: ‘<!DOCTYPE html>’ and ‘<html></html>’.”
Figure: At least ChatGPT doesn’t say “tags.”

Anyone checking their HTML on conformance—validating—would find the problems with the ChatGPT output and be able to deduce this most minimal document. But commercially, unfortunately, the data says that modern web development teams don’t focus on conformance *.

That’s why “this” seems worth repeating even more.

* Should they? For professionals, I absolutely think so.