Why HTML has both <b / i> and <strong / em>?
Mustapha Aouas

Mustapha Aouas @mustapha

About: Technical writer, speaker & JS / TS developer — I like sharing what I know and learning what I don't 👨🏻‍💻 — Angular Lyon co-organizer

Location:
France
Joined:
Jun 2, 2019

Why HTML has both <b / i> and <strong / em>?

Publish Date: Sep 16 '24
91 23

TLDR;

  • The b and i tags are from HTML's past, focusing on appearance.
  • The strong and em tags represent HTML's present and future, focusing on meaning.

As a web developer, you might have noticed something puzzling. There seem to be two sets of tags that do very similar things:
1 The b tag makes text bold, and the i tag makes it italic.
2 The strong tag also makes text bold, and the em tag makes it italic.

So why does HTML have both? Aren't they doing the same job? Well, not exactly. Let's uncover the story behind these seemingly redundant pairs.

A Brief History Lesson

To understand why we have both sets of tags, we need to take a quick trip back in time. When HTML was first created in the early 1990s, it included the b and i tags. These tags were straightforward: b made text bold, and i made it italic. Simple, right?

But as the web evolved, developers and designers realised something important: HTML shouldn't just be about how things look. It should also be about what things mean.

Enter Semantic HTML

This realisation led to the concept of "semantic HTML”. The word "semantic" refers to the meaning of something. In the context of HTML, it means using tags that describe what the content is, not just how it looks.

This is where strong and em come in. These tags were introduced to give meaning to the text, not just change its appearance:

  • strong indicates that the text is important or urgent.
  • em (short for emphasis) suggests that the text should be stressed when read.

So, here's the big difference:

  • b and i are about appearance. They tell the browser, "Make this text bold" or "Make this text italic."
  • strong and em are about meaning. They tell the browser, "This text is important" or "This text should be emphasised”.

Why Does It Matters

You might be thinking, "Okay, but they still look the same on the page. Why should I care?”.
Well, I see two main reasons why this distinction is important:

  • Accessibility: Screen readers (software that reads web pages aloud for visually impaired users) can interpret strong and em tags to add the right tone or emphasis when reading the text. They might just skip over b and i tags.
  • Search engines: Some search engines might give more weight to text within strong tags, considering it more important.

When to Use Which?

Let's look at an example to make this clearer:

The zoo's new panda, named Mei Lan, will make her
<strong>public debut next Tuesday, July 16</strong>. 
Visitors are advised to arrive <em>early</em> as large 
crowds are expected. 

<b>Note:</b> Her favorite food is <i>bambusa vulgaris</i>,
a type of bamboo.
Enter fullscreen mode Exit fullscreen mode

In this example:

  • strong is used for the important information about the debut date.
  • em emphasises that visitors should arrive early.
  • b is used for a note that's visually distinct but not necessarily more important.
  • i is used for the scientific name of the bamboo species.

The Bottom Line

While b/i and strong/em might look the same on a webpage, they serve different purposes.

  • The b and i tags are from HTML's past, focusing on appearance.
  • The strong and em tags represent HTML's present and future, focusing on meaning.

As a general rule, it's best to use strong and em in your HTML. They provide more information about your content's meaning and can improve accessibility and search engine optimisation.

However, b and i still have their places for purely visual styling or in specific situations where you don't want to imply extra importance or emphasis. That said, for simple visual styling, you can use a span elements with CSS classes, as it offers more flexibility and maintains a clearer separation between content and presentation.

Good HTML isn't just about making pages look right — it's about making them mean right too ;)

Comments 23 total

  • Himanshu Sorathiya
    Himanshu Sorathiya Sep 16, 2024

    Thanks for sharing this, I had same questions

  • Best Codes
    Best CodesSep 16, 2024

    Nice article. :) Very informative.

  • Eckehard
    EckehardSep 16, 2024

    For a truely modern formatting, these tags are just small drops on a very hot stone. So we could also ask, why the very few tags the history of HTML provided for formatting should be used at all, while 99% of the formatting is done in CSS.

    • Billy Johnson
      Billy JohnsonSep 20, 2024

      The article did say 1990's and some websites and search engines STILL use these today ... not everything is an app just yet.

      *looking at you Japanese websites!!

      • Eckehard
        EckehardSep 20, 2024

        Even writing on stone plates is not totally uncommon today...

        IE

  • It's Just Nifty
    It's Just NiftySep 16, 2024

    What a great explanation!

  • K Om Senapati
    K Om Senapati Sep 17, 2024

    Informative. I didn't know the differences between them.

  • João Angelo
    João AngeloSep 17, 2024

    Hi Mustapha Aouas,
    Top, very nice and helpful !
    Thanks for sharing.

  • Aral Roca
    Aral RocaSep 24, 2024

    Thanks for the article, I didn't know the difference. I have to say that for me semantically I understand better that b is from bold and i from italic and I like that they are less bytes, but it is also the habit of years and years using them, if I started today I would find it much better strong than b, although "em" to me is more confusing to relate it to italic than i...

    • Ben Sinclair
      Ben SinclairSep 25, 2024

      Imagine having a paragraph quote, which is styled to be entirely italicised.

      Inside that quote, you want to have a word or phrase emphasised, like the name of a book for example. With <i>, you're limited to turning italics on.

      If you then use CSS to say that, for example,

      blockquote {
        font-style: italic;
      }
      
      blockquote i {
        font-style: normal; 
      }
      
      Enter fullscreen mode Exit fullscreen mode

      then it's pretty confusing to read. There's literally a rule saying, "make italic text not italic". If you take the visual wording away, then it's easier to read because there's no contradiction.

  • anna lapushner
    anna lapushnerSep 24, 2024

    This is really useful. It love best practices knowledge gain. Thank you!

  • Laércio Santos
    Laércio SantosSep 27, 2024

    Underrated information. Thanks for it!

  • Joel Orobor
    Joel OroborSep 28, 2024

    Nice article, thanks for sharing.

  • Jens Oliver Meiert
    Jens Oliver MeiertSep 28, 2024

    The “b” and “i” elements did get an updated meaning with what was called “HTML 5.” (The HTML spec clarifies on the meanings and gives examples.)

    The four elements are distinct and can be used (preferably according to their purpose).

  • Jens Oliver Meiert
    Jens Oliver MeiertSep 28, 2024

    The “b” and “i” elements did get an updated meaning with what was called “HTML 5.” (The HTML spec clarifies on the meanings and gives examples.)

    The four elements are distinct and can be used (preferably according to their purpose).

  • Jens Oliver Meiert
    Jens Oliver MeiertSep 28, 2024

    The b and i elements did get an updated meaning with what was called “HTML 5,” which is now the HTML living standard. The HTML spec explains the meanings of all elements and provides examples, including b and i.

    The four elements are distinct and can be used (preferably according to their purpose).

    There has been lots of confusion around these elements—therefore good to discuss them!—, but they do have a place.

  • Tomasz Jakut
    Tomasz JakutOct 2, 2024

    b and i are about appearance. They tell the browser, "Make this text bold" or "Make this text italic."

    That's no longer true. These elements were updated in HTML5 and are described in the spec.

    The b element:

    The b element represents a span of text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood, such as key words in a document abstract, product names in a review, actionable words in interactive text-driven software, or an article lede.

    The i element:

    The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, transliteration, a thought, or a ship name in Western texts.

    In fact, I would argue that the i element has far more use cases than the em element. The latter is used only for stress emphasis:

    The em element represents stress emphasis of its contents.

    Your example showing usage of these elements is in-pair with what the specification says:

    1. You used strong to mark up the most important part of the text (the date of the debut).
    2. You used em to correctly put stress emphasis the word "early".
    3. You used b to bring attention to the "Note" word without marking it as more important than the rest of the content.
    4. You used i to mark up a scientific term.

    Due to that, I'm quite confused because the example contradicts what you said about these elements.

  • Ansara Costa
    Ansara CostaOct 15, 2024

    Excelente. Nos cursos do Brasil os professores mostram as Tags "strong" e "em" mas não explicam corretamente o motivo de haver Tags parecidas. Realmente os conteúdos de tecnologia em Inglês é muito superior e melhor que os conteúdos em português. Obrigada pela explicação.

  • Yunesh Shrestha
    Yunesh ShresthaOct 21, 2024

    Great

  • thatoddshade
    thatoddshadeJan 26, 2025

    really well explained! will check what I use on my own website.

Add comment