Frontend Comparisonbeginner

HTML vs HTML5: What Is the Difference?

HTML5 is the modern version of HTML. See what changed from HTML 4, the new semantic and media tags, new form inputs, and what you should learn today.

5 min read

Our verdict in 30 seconds

HTML is the language for web page structure. HTML5 is its modern version, which added semantic tags like header, nav and article, built-in audio and video, canvas, new form input types and a short doctype. Today HTML is maintained as a living standard, so when you learn HTML now, you are learning HTML5 and later.

On This Page

HTML vs HTML5 is not a contest between two languages. HTML is the markup language that gives a web page its structure. HTML5 is the modern version of it. HTML5 added meaningful layout tags, built-in audio and video, drawing with canvas, smarter form inputs and a short doctype. When you learn HTML today, you are learning HTML5 and the updates that came after it.

HTML vs HTML5: the difference table

Point Older HTML (HTML 4.01 and before) HTML5
Doctype Long line with a URL <!DOCTYPE html>
Page layout Mostly <div> with ids <header>, <nav>, <main>, <article>, <footer>
Audio and video Needed plugins such as Flash <audio> and <video> built in
Drawing graphics Not possible without plugins <canvas> and inline <svg>
Form inputs Mostly text, password, checkbox, radio Adds email, number, date, range, color and more
Form checks Needed JavaScript required, min, max, pattern built in
Character set line Long <meta http-equiv> line <meta charset="UTF-8">
Presentation tags <font>, <center> allowed Removed; use CSS
Frames <frameset>, <frame> Removed; <iframe> remains

A short history

  • HTML 4.01 became a W3C Recommendation in December 1999. It was the main version for about ten years.
  • HTML5 became a W3C Recommendation in October 2014.
  • In 2019, the W3C and the WHATWG agreed that the WHATWG HTML Living Standard is the one HTML standard.

So "HTML5" is now mostly a common name. The real standard keeps changing in small steps, and browsers follow it.

The doctype: the first visible change

An HTML 4.01 Strict page started like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

An HTML5 page starts like this:

<!DOCTYPE html>

That is all. It is short and easy to remember. Without a doctype, browsers can switch to "quirks mode" and lay out your page in an old, inconsistent way. So always keep this line at the top.

New HTML5 tags with examples

Semantic layout tags

Older pages used <div id="header"> and <div id="menu">. HTML5 gives these parts proper names:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My College Blog</title>
</head>
<body>
  <header>
    <h1>My College Blog</h1>
    <nav>
      <a href="/">Home</a>
      <a href="/notes">Notes</a>
    </nav>
  </header>

  <main>
    <article>
      <h2>How I Learned Loops</h2>
      <p>Loops repeat a block of code...</p>
    </article>
    <aside>Popular posts</aside>
  </main>

  <footer>Written by a second-year student</footer>
</body>
</html>

These tags look the same as a <div> by default. The benefit is meaning:

  • Screen readers can jump straight to <nav> or <main>, which helps blind users.
  • Search engines can understand which part is the main content.
  • Other developers can read your code faster.
Tag Use it for
<header> Top of a page or section, logo, title
<nav> Main navigation links
<main> The main content, once per page
<article> Content that makes sense on its own, like a blog post
<section> A themed group of content with a heading
<aside> Side content, like related links
<footer> Bottom of a page or section
<figure> and <figcaption> An image or diagram with a caption

Audio and video

Before HTML5, playing a video needed a plugin such as Flash. Now it is one tag:

<video src="intro.mp4" controls width="480">
  Your browser does not support the video tag.
</video>

<audio src="lecture.mp3" controls></audio>

The controls attribute shows play, pause and volume buttons. The text inside shows only in very old browsers.

Canvas

<canvas> gives you a drawing area that JavaScript can paint on. It is used for charts, simple games and image editing.

<canvas id="board" width="200" height="100"></canvas>
<script>
  const ctx = document.getElementById("board").getContext("2d");
  ctx.fillStyle = "teal";
  ctx.fillRect(20, 20, 150, 60);
</script>

This draws a teal rectangle.

New form inputs and built-in checks

<form>
  <input type="email" name="email" placeholder="you@example.com" required>
  <input type="number" name="age" min="17" max="30">
  <input type="date" name="dob">
  <input type="range" name="level" min="1" max="10">
  <button type="submit">Register</button>
</form>

Without writing any JavaScript:

  • type="email" stops submission if the value is not a valid email format.
  • required stops an empty submission.
  • min and max limit the number.
  • On phones, email and number open a matching keyboard.

Common mistake: Trusting browser checks for security. A user can switch them off or send data without the form. Always check the data again on the server.

Tags removed in HTML5

Some tags only controlled looks. HTML5 made them obsolete because CSS does that job better.

Old tag Use instead
<font color="red"> CSS color: red;
<center> CSS text-align: center; or flexbox
<big> CSS font-size
<strike> <s> or <del>, or CSS
<frameset>, <frame> Normal pages, or <iframe> for embedding
<acronym> <abbr>

Browsers may still show old tags for backward compatibility, but you should not use them in new code.

<b> and <i> were kept, but with a narrower meaning. For importance use <strong>, and for stress use <em>.

Some features often called "HTML5" are really separate browser APIs that arrived around the same time:

  • Web Storage (localStorage and sessionStorage) to save small data in the browser
  • Geolocation to get the user's location, with permission
  • Drag and drop

Interviewers may group these under HTML5, so know what each one does.

What should a beginner learn?

Learn modern HTML, then CSS, then JavaScript. Skip HTML 4 tutorials completely.

  1. Page structure: doctype, <html>, <head>, <body>.
  2. Text, links, images and lists.
  3. Semantic layout tags from this page.
  4. Forms with the new input types.
  5. Tables, audio and video.

Follow the HTML tutorial, then style your pages with the CSS tutorial. Try each example above in the online HTML, CSS and JS editor to see the result instantly. If you want to know what happens after you press Enter on a URL, read how websites work.

Pro tip: Open any well-known website, right-click and choose "View page source". Look for <header>, <nav> and <main>. Seeing semantic tags used on real sites makes them easier to remember.

Interview questions on HTML vs HTML5

Question Short answer
What is the HTML5 doctype? <!DOCTYPE html>
Name five new HTML5 tags header, nav, article, video, canvas
Difference between <section> and <article>? Article stands alone; section groups related content
localStorage vs sessionStorage? Local stays after closing the browser; session clears when the tab closes
Why use semantic tags? Accessibility, search engines and readable code

Practise more in the HTML interview questions set.

Interview note: If asked "What is the difference between HTML and HTML5?", say: "HTML5 is the modern version of HTML. It added semantic tags, native audio and video, canvas, new input types and a simple doctype, and removed presentation tags like font." Then give one code example, such as <input type="email" required>.

Frequently Asked Questions

Is HTML5 different from HTML?
HTML5 is a version of HTML, not a separate language. It keeps most older tags, adds new ones and removes a few presentation tags. Pages written in HTML5 still use the same basic structure of elements and attributes.
Do I need to learn old HTML before HTML5?
No. Learn modern HTML directly. You only need to recognise old tags such as font and center so you can update old code.
What is the HTML5 doctype?
It is simply <!DOCTYPE html> at the top of the file. It tells the browser to use standards mode. The older HTML 4.01 doctype was a long line with a URL.
Is there an HTML6?
No version called HTML6 is planned. Since 2019 the WHATWG HTML Living Standard is the single HTML standard, and it is updated continuously instead of in numbered versions.
Do all browsers support HTML5?
All current major browsers support the common HTML5 features such as semantic tags, audio, video, canvas and the new input types. Some input types look different from browser to browser.

Want to Build Your Career in Java Full Stack with AI?

Join CodeBegun and train with working industry engineers — Explore the Java Full Stack program

Apply for Demo Class →
Siva Prasad Galaba
Founder, CodeBegun · Staff Engineer

Founder of CodeBegun. 15+ years building Java systems at companies like Crunchyroll. Teaches Java, Spring Boot and system design the way the industry actually works, and mentors students through projects, mock interviews and placement preparation.

Technically reviewed by CodeBegun Technical TeamLast reviewed 4 December 2026 LinkedIn

More comparisons

View all
Chat with us