Free auditStart free
GlossaryGlossary · Web development

Semantic HTML

Semantic HTML uses elements that describe their content, like main, article and section. See the key elements, div vs section, and what Google says about it.

3 min
read
6
sources
Oct 24, 2026
updated
Scaplet Editorial Team
author
In one line

Semantic HTML means choosing elements by what the content is, not how it looks: a heading element for a heading, main for the dominant content, article for a self-contained piece. MDN says to code HTML to represent the data and leave presentation to CSS. It helps screen readers and developers. Google says it can rarely depend on HTML semantics, so it is not a ranking lever.

30-second check

Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
01Explained

What semantic HTML means

MDN's glossary says HTML "should be coded to represent the data that will be populated and not based on its default presentation styling." Presentation is CSS's job. A <span> styled at 32 pixels can look like a top-level heading, but MDN notes it "has no semantic value", so it earns none of the benefits of a real heading.

So the test for any element is simple: what is this content? A list, a heading, a figure with a caption, a self-contained article? Pick the element that says so.

02At a glance

The elements that matter most

Element

<main>

What the HTML spec or MDN says it is for
The dominant content of the body: content directly related to or expanding on the central topic of the document. MDN says a document must not have more than one <main> without the hidden attribute
Element

<article>

What the HTML spec or MDN says it is for
A complete, self-contained composition that could in principle be distributed or reused on its own, such as a blog entry, a forum post or a user-submitted comment
Element

<section>

What the HTML spec or MDN says it is for
A generic section of a document: a thematic grouping of content, typically with a heading
Element

<div>

What the HTML spec or MDN says it is for
The generic container for flow content. MDN says it has no effect on content or layout until styled with CSS

MDN's glossary also lists <aside>, <details>, <figure>, <figcaption>, <footer>, <header>, <nav>, <time> and others among the roughly 100 semantic elements.

03Check it

div or section?

The HTML Standard is blunt about this: "The section element is not a generic container element. When an element is needed only for styling purposes or as a convenience for scripting, authors are encouraged to use the div element instead." Its rule of thumb is that <section> fits only if the element's contents would be listed explicitly in the document's outline.

If the content could be syndicated on its own, the standard says to prefer <article> over <section>.

Choosing elements by meaning
<main>
  <article>
    <h1>How to pick a running shoe</h1>
    <section>
      <h2>Fit</h2>
      <p>...</p>
    </section>
    <div class="promo-box">   <!-- styling only: div, not section -->
      ...
    </div>
  </article>
</main>
04Good to know

What it does for SEO

MDN's glossary says semantic markup helps screen readers navigate, makes blocks of meaningful code easier to find, and says search engines consider semantic content important. Google's SEO starter guide is more cautious on the search side. On heading order it says that headings in semantic order are "fantastic for screen readers" but that for Google Search it doesn't matter if they are out of order, because "The web in general is not valid HTML, so Google Search can rarely depend on semantic meanings hidden in the HTML specification."
05How it works

Check your own pages in two minutes

  1. 1

    Open DevTools

    Right-click the page and choose Inspect, then look at the Elements panel.

  2. 2

    Look for walls of div

    Find headings, lists, navigation and the main content. If they are <div> or <span> with classes, a screen reader gets no signpost.

  3. 3

    Count the main elements

    Search the DOM for <main. There should be one visible one.

  4. 4

    Check each section has a heading

    MDN says sections should always have a heading, with very few exceptions. A <section> without one is usually a <div>.

Sources · 6

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • mozilla.org
  • whatwg.org
  • google.com
  1. 01MDN: Semantics (glossary)developer.mozilla.org · checked 2026-10-25
  2. 02HTML Standard (WHATWG): Sectionshtml.spec.whatwg.org · checked 2026-10-25
  3. 03MDN: The Generic Section elementdeveloper.mozilla.org · checked 2026-10-25
  4. 04MDN: The Main elementdeveloper.mozilla.org · checked 2026-10-25
  5. 05MDN: The Content Division elementdeveloper.mozilla.org · checked 2026-10-25
  6. 06Google Search Central: SEO Starter Guidedevelopers.google.com · checked 2026-10-25
Questions

Asked a lot.

4 questions people ask next, answered from the sources on this page.

01What are semantic tags in HTML?

Elements whose names say what their content is, such as <main>, <article>, <section>, <figure> and <time>, as opposed to generic containers like <div> and <span>.

02Is semantic HTML a Google ranking factor?

Google does not list it as one. Its starter guide says Google Search can rarely depend on semantic meanings in the HTML specification, because most of the web is not valid HTML.

03What is the difference between semantic and non-semantic elements?

A semantic element describes its content: a heading, an article, a list. A non-semantic element like <div> is a generic container that says nothing about what it holds.

04Does semantic HTML help accessibility?

Yes. MDN's glossary says screen readers can use semantic elements as a signpost to help visually impaired users navigate a page.

Free · 2 minutes

Know the term. Now check your site.

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly