Free Lesson

What Is HTML?

HTML (HyperText Markup Language) is the code that gives every web page its structure. It uses short tags like <h1> and <p> to tell the browser which text is a heading, a paragraph, a link or an image.

Tim Berners-Lee created HTML in 1991 for the first website, and every page you visit today is still built on it. Edit a real page below and watch it change.

Interactive demo

HTML live editor

Live HTML editor

Change the text, add a tag or edit an attribute. The preview updates as you type. Scripts are switched off and nothing leaves your browser.

Browser preview

The basics

Tags, elements and attributes

Tag

<p> </p>

A keyword in angle brackets. Most come in pairs: an opening tag <p> and a closing tag </p> with a slash.

Element

<p>Hello</p>

The opening tag, the content and the closing tag together. This whole thing is one paragraph element.

Attribute

<a href="https://example.com">

Extra information inside the opening tag, written as name="value". Here href tells the link where to go.

Anatomy

The parts of every HTML page

  1. <!DOCTYPE html>

    Doctype: Tells the browser this is a modern HTML5 page.

  2. <html lang="en">

    html element: Wraps the whole page. lang says which language it is written in.

  3. <head> ... </head>

    head: Information about the page: the tab title, description and links to CSS. Not shown on the page itself.

  4. <title>My page</title>

    title: The text in the browser tab and the blue link in Google results.

  5. <body> ... </body>

    body: Everything visitors actually see: headings, paragraphs, images, links and buttons.

Step by step

Build your first web page in 5 steps

  1. 1. Create a file

    Open any text editor (Notepad, TextEdit in plain-text mode, or VS Code) and save an empty file as index.html.

    index.html
  2. 2. Add the skeleton

    Type the doctype, then html, head and body tags. This structure is the same on every web page.

    <!DOCTYPE html>
    <html lang="en">
      <head></head>
      <body></body>
    </html>
  3. 3. Give it a title

    Inside head, add a title element. It shows in the browser tab.

    <head>
      <title>My first page</title>
    </head>
  4. 4. Add content

    Inside body, add a heading and a paragraph. Close every tag you open.

    <body>
      <h1>Hello, world!</h1>
      <p>I made this page myself.</p>
    </body>
  5. 5. Open it in a browser

    Save the file and double-click it. Your browser opens it as a real web page. Edit, save and refresh to see changes.

    File > Open > index.html

What is HTML used for?

  • Building the structure of every website and web app
  • Writing blog posts, articles and documentation
  • Formatting emails and newsletters
  • Making web pages readable by search engines and screen readers
  • Embedding images, video, audio, forms and maps

HTML vs CSS vs JavaScript

HTML: Structure
What is on the page: headings, text, images, links.
CSS: Style
How it looks: colors, fonts, spacing, layout.
JavaScript: Behavior
What it does: clicks, animations, live updates.

Honest answer

Is HTML easy to learn?

Yes, it is the easiest place to start. HTML has no logic to get wrong, only tags that label content, so you can build a working page in an afternoon. About 20 tags cover most pages. The harder parts come later with CSS layout and JavaScript, which build on the HTML you already know.

Quick HTML quiz

Six questions on what HTML is and how it works.

  1. What does HTML stand for?
  2. Is HTML a programming language?
  3. Which tag makes the biggest heading?
  4. In <a href="page.html">, what is href?
  5. Where does the visible page content go?
  6. Which language styles a page with colors and fonts?

Building web pages with AI?

Code Card turns your Claude Code, Codex, and OpenClaw sessions into a public developer profile with activity graphs, streaks, badges, and a shareable card. Start with npx code-card.

Make your Code Card

FAQ

HTML questions, answered

What is HTML in simple terms?

HTML (HyperText Markup Language) is the code that gives every web page its structure. It uses tags like <h1> and <p> to tell the browser which text is a heading, a paragraph, a link or an image.

Is HTML easy to learn?

Yes. HTML is one of the easiest things to learn in tech because it has no logic, only tags. Most beginners can build a simple page in an afternoon and learn the common tags in a week or two.

What are five uses of HTML?

HTML is used to structure websites and web apps, write blog posts and documentation, format emails, help search engines and screen readers understand a page, and embed images, video, forms and maps.

Does anyone still use HTML?

Every website still uses HTML. Frameworks like React and site builders like WordPress generate HTML behind the scenes, because HTML is the only page format every browser reads.

What is the difference between HTML and CSS?

HTML decides what is on the page and what each part means. CSS decides how it looks: colors, fonts, spacing and layout. Most pages use both, plus JavaScript for interactivity.