HTML is the language that gives a web page its structure. HTML5 is the version that arrived in 2014 and changed what a page could do on its own: play video, check forms, draw graphics or work without a connection, with no extra programs.
Today the distinction is mostly historical. When somebody says "HTML", they mean what HTML5 started. Knowing what changed is still useful if you maintain an old site, study web development or read code written years ago.
A short history
| Year | What happened |
|---|---|
| 1993 | First description of HTML, by Tim Berners-Lee and Dan Connolly |
| 1995 | HTML 2.0, the first standard |
| 1997 | HTML 3.2 and 4.0 |
| 1999 | HTML 4.01, the version that lasted longest |
| 2000 | XHTML 1.0, stricter, based on XML |
| 2004 | Browser makers form the WHATWG and start what would become HTML5 |
| 2014 | HTML5 becomes a W3C recommendation |
| 2019 | W3C and WHATWG agree on a single, living standard |
Since then there are no version numbers. The HTML Standard is updated continuously, and browsers add new features one by one. So HTML6 doesn't exist, and nobody plans it.
The main differences
| HTML 4.01 | HTML5 and today | |
|---|---|---|
| Document type | Long and confusing | <!DOCTYPE html> |
| Structure | <div> for everything | <header>, <nav>, <main>, <article>, <footer> |
| Audio and video | Flash or other plugins | <audio>, <video> |
| Drawing | Images or Flash | <canvas> and inline SVG |
| Forms | Text, with checks in JavaScript | Email, date, number, with checks built in |
| Saving data in the browser | Cookies | Web storage, IndexedDB |
| Offline use | No | Service workers |
| Location, drag and drop, camera | No | Yes, with permission |
| Errors in the code | Each browser guessed | Defined rules, the same for all |
The differences, with examples
The beginning of the page
Before:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">Now:
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">That first line also decides how the browser draws the page. Without it, it falls into a compatibility mode that imitates browsers from the nineties, and sizes go wrong.
Structure with meaning
Before, a page was a pile of boxes:
<div id="top">...</div>
<div id="menu">...</div>
<div id="content">...</div>Now the names say what each part is:
<header>...</header>
<nav>...</nav>
<main>
<article>...</article>
</main>
<footer>...</footer>It isn't only neatness. A screen reader can jump straight to <main>, and search engines tell the article from the menu.
Video and audio
Before, you needed Flash. Adobe retired it at the end of 2020, so those pages no longer work.
<video controls width="640" poster="cover.jpg">
<source src="tour.webm" type="video/webm">
<source src="tour.mp4" type="video/mp4">
</video>Forms
<label for="mail">Email</label>
<input id="mail" type="email" required>
<input type="date">
<input type="number" min="1" max="10">The browser checks the address, shows a calendar, and on a phone opens the right keyboard. You still have to check everything again on the server, since anybody can skip the browser.
Storing data
localStorage.setItem('theme', 'dark');Unlike cookies, this isn't sent to the server with every request. Don't keep passwords or private data there: any script on the page can read it.
Tags you should no longer use
| Old | Use instead |
|---|---|
<font>, <center>, <big> | CSS |
<b> for importance | <strong> |
<i> for emphasis | <em> |
<strike> | <del> or <s> |
<frame>, <frameset> | One page, or <iframe> for external content |
<acronym> | <abbr> |
<applet> | Nothing: Java in the browser is gone |
| Tables to place things | CSS Grid and Flexbox |
<b> and <i> still exist, for text that looks different without being more important.
New since 2014
The living standard keeps growing. Things you may not have tried:
<dialog>for windows, without libraries.<details>and<summary>for sections that open.loading="lazy"on images, to load them when needed.<picture>to serve different images by size or format.- The
popoverattribute for menus and hints. inert, to turn off a part of the page.
Check the support of each one on MDN or Can I use.
How to update an old page
- Change the first line to
<!DOCTYPE html>and addlangto<html>. - Pass it through the W3C validator and fix the errors, starting from the top.
- Replace Flash and other plugins with
<video>,<audio>or an embedded player. - Swap the main
<div>boxes for<header>,<nav>,<main>and<footer>. - Move colors, sizes and alignment to CSS.
- Add
<meta name="viewport" content="width=device-width, initial-scale=1">so that it adapts to phones. - Test it with the keyboard and on a phone.
If the site is large and old, rebuilding it on a content system usually costs less than fixing every page. Our web design team does that with WordPress, whose current themes already produce modern HTML. If you want to do it yourself, begin with the template hierarchy.
Frequently asked questions
Should I learn HTML or HTML5?
They are the same thing now. Any recent course teaches current HTML.
Is HTML5 a programming language?
No. It describes the content. What people called "HTML5" in applications was the combination of HTML, CSS and JavaScript.
Do old pages stop working?
Almost never. Browsers keep reading HTML from thirty years ago. What fails are the plugins around it.
