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.

About Me

Jens Oliver Meiert, on November 9, 2024.

I’m Jens (long: Jens Oliver Meiert), and I’m a web developer, manager, and author. I’ve been working as a technical lead and engineering manager for small and large enterprises, I’m an occasional contributor to web standards (like HTML, CSS, WCAG), and I write and review books for O’Reilly and Frontend Dogma.

I love trying things, not only in web development and engineering management, but also in other areas like philosophy. Here on meiert.com I share some of my experiences and views. (I value you being critical, interpreting charitably, and giving feedback.)