HTML is the markup language used to structure web pages, and HTML5 is the version of it that the W3C standardised in 2014. In practice the difference between HTML and HTML5 is that HTML5 added semantic elements, native audio and video, canvas, richer form controls, a simpler doctype and a precise parsing algorithm, replacing most plug-ins and workarounds of older HTML 4 pages.
Today "HTML5" mostly means "modern HTML". The specification is now the HTML Living Standard, so there are no new numbered versions, but the comparison of html vs html5 is still useful because older tutorials and code are written in the HTML 4 style.
"HTML" is the name of the language. "HTML5" is a specific generation of it, following HTML 4.01 (1999) and the abandoned XHTML line. Before HTML5, the web relied on browser plug-ins such as Flash for video, and on scripts and images to build rounded corners or structure.
HTML5 changed three things at once:
The doctype tells the browser to render in standards mode. HTML 4.01 used a long, hard-to-remember declaration. HTML5 needs only one short line.
Character encoding is also simpler: <meta charset="utf-8"> replaces the older http-equiv form. A modern page also adds the viewport meta tag so it works on phones.
In HTML 4 almost every layout region was a <div> with an id such as header or nav. HTML5 gives those regions real names, which helps screen readers, search engines and other developers.
The main new structural elements are <header>, <nav>, <main>, <article>, <section>, <aside>, <footer>, <figure> and <figcaption>. They do not change how a page looks by default; the benefit is meaning.
Before HTML5, playing video required a plug-in. Now it is one element:
HTML5 also introduced <canvas> for scripted bitmap drawing, and inline SVG for vector graphics inside the page. Flash is discontinued and no longer supported in browsers, so these elements are the standard replacement.
HTML 4 only had text, password, checkbox, radio, file, submit and a few other inputs. HTML5 added input types and built-in validation, so many checks need no JavaScript.
New attributes include required, placeholder, pattern, autofocus, min, max and list (with <datalist>). The browser shows the right keyboard on mobile and reports validation errors itself.
HTML5 is more than markup. It standardised APIs such as localStorage and sessionStorage, the Geolocation API, Drag and Drop, the History API, Web Workers and later Fetch, WebSockets and more. Many of these are now maintained as separate specifications, but they started under the HTML5 banner.
Several presentational elements from HTML 4 were removed or declared obsolete:
| HTML 4 feature | Status in HTML5 and later | Use instead |
|---|---|---|
<font>, <center>, <big> | Obsolete | CSS |
<frame>, <frameset> | Obsolete | <iframe> and CSS layout |
<acronym> | Obsolete | <abbr> |
bgcolor, align attributes | Obsolete | CSS properties |
Browsers still render many obsolete tags, but you should not write them in new pages.
| Area | HTML 4.01 | HTML5 |
|---|---|---|
| Doctype | Long DTD reference | <!DOCTYPE html> |
| Structure | <div> everywhere | Semantic elements |
| Video and audio | Plug-ins | <video> and <audio> |
| Graphics | Images, plug-ins | <canvas>, inline SVG |
| Forms | Basic inputs, script validation | New types and built-in validation |
| Error handling | Different in each browser | One defined parsing algorithm |
No. HTML5 is the fifth major version of the same language. Pages written for older HTML mostly still work, because HTML is designed to be backward compatible.
It is widely understood and fine in conversation, but the precise name of the current standard is the HTML Living Standard. Writing "HTML" or "HTML5 and CSS3" both communicate the same skill.
HTML5 elements work on their own, but real pages use CSS for appearance and JavaScript for behaviour. HTML only supplies structure and content.
All current evergreen browsers support the core of HTML5. For newer features, check browser support tables before relying on them.
HTML is the language; HTML5 is the modern generation that added semantic elements, native media, canvas, better forms, built-in APIs, a short doctype and a consistent parsing algorithm. Use <!DOCTYPE html>, semantic structure and CSS for styling, and leave behind the font, center and frame tags of HTML 4.