b vs strong and i vs em in HTML: what is the difference?

BeginnerHTML and accessibility interview questionBy , updated 17 November 2026

Short answer

<strong> marks text as important, serious or urgent, and <em> marks stress emphasis that changes how a sentence reads. <b> and <i> look the same by default (bold and italic) but add no importance: <b> draws attention to a keyword or product name, and <i> marks an alternate voice such as a technical term, a foreign phrase or a ship's name. Choose by meaning, then style with CSS.

Semantics vs presentation

In early HTML, <b> and <i> simply meant "make this bold" and "make this italic". HTML5 redefined all four elements by meaning, because how text looks is CSS's job. Today the browser's default styles are the only thing the pairs share:

Element Means Default style Typical use
<strong> Strong importance, seriousness or urgency Bold "Warning: this deletes your account"
<em> Stress emphasis that changes the meaning Italic "I did send the email"
<b> Attention drawn for a practical reason, with no extra importance Bold Keywords in a summary, product names in a review, the lead-in of an article
<i> Text in an alternate voice or mood Italic Technical terms, taxonomic names, foreign phrases, thoughts, names of ships

The test for <em> is to read the sentence aloud. Moving the stress changes the meaning:

<p><em>I</em> never said she took the money.</p>   <!-- someone else said it -->
<p>I never said <em>she</em> took the money.</p>   <!-- someone else took it -->

The test for <strong> is whether the text matters more than what surrounds it: a warning, a deadline, the one step a user must not skip. Nesting <strong> inside <strong> raises the importance further; nesting <em> raises the stress.

When <b> and <i> are still right

They are not deprecated. They are for text that is set apart by convention, where <strong> or <em> would claim a meaning the text does not have:

<p>The <i lang="la">Felis catus</i> is a small domesticated carnivore.</p>
<p>The <i>HMS Beagle</i> left Plymouth in 1831.</p>
<p><b>Aster X2</b> review: comfortable headphones, but the battery is average.</p>
<p>Set <i>box-sizing</i> to <code>border-box</code> before anything else.</p>

Add a lang attribute when <i> holds a phrase in another language, so screen readers can switch pronunciation. If a more specific element exists, use it instead: <cite> for the title of a work, <dfn> for the defining instance of a term, <code> for code, <abbr> for an abbreviation.

What screen readers actually do

The meaning of <strong> and <em> is exposed to assistive technology: in the accessibility tree they carry the strong and emphasis roles. In practice, most screen readers do not change their voice or announce emphasis with default settings, and some offer an option to report it. So the honest answer in an interview is:

  • Do not rely on <strong> or <em> alone to convey something critical. If a warning matters, say so in words ("Warning:") or use a proper alert pattern.
  • Still use them correctly. They are the semantic signal that browser reader modes, translation tools, search engines and future assistive tools can use, and they keep your markup honest.
  • <b> and <i> carry no role; they are announced as plain text.

The broader case for meaningful markup is in What is semantic HTML, and why does it matter?.

<mark> and <small>

Two more inline elements that are often misused as styling tags:

  • <mark> highlights text for its relevance in the current context, for example search terms in results or the part of a quote you are commenting on. It does not mean important (that is <strong>). Default style is a yellow background.
  • <small> is for side comments and fine print: copyright lines, legal disclaimers, licence notes. It is not "smaller text"; use CSS font-size for that.
<p>Results for "closure": a <mark>closure</mark> is a function that remembers its scope.</p>
<p><small>Prices include GST. Offer ends 30 November.</small></p>

Related, less common: <u> marks an unarticulated annotation such as a spelling error (not a link look-alike), <s> marks text that is no longer accurate, and <del> and <ins> record edits to a document.

Styling is separate

None of these elements should be chosen for how they look. If you want a heading-like bold label with no meaning, use CSS (font-weight: 600) on a <span> or the element that is already there. If you want <strong> text in a different colour or weight, restyle it:

strong { font-weight: 700; color: #a00; }
em { font-style: normal; text-decoration: underline wavy; }

The meaning stays, and only the look changes. Icon libraries that use <i class="icon-..."> are a misuse of <i>; prefer <span aria-hidden="true"> or an inline SVG.

Practise it

Common follow-up questions

Does <strong> help SEO more than <b>?

There is no good evidence that either changes ranking in a meaningful way. Use them for readers, not for search engines. Headings, titles and the content itself matter far more.

Which one does a rich text editor's Bold button produce?

It depends on the editor. Many produce <strong> and <em>, some produce <b> and <i>, and some produce styled <span>s. If you sanitise or store the HTML, normalise it to one choice.

Is <i> deprecated?

No. It was redefined in HTML5 with a meaning (alternate voice) and is valid HTML. Only its old purely visual meaning is gone.

What should I use for a word that is bold for design only?

CSS on a neutral element, such as <span class="label">. If it is a keyword set apart by convention, <b> is fine. If it is genuinely important, <strong>.

Mistakes to avoid

  • Using <strong> everywhere bold text appears, which dilutes what "important" means

  • Using <b> or <i> purely to get a look, instead of CSS

  • Relying on bold or italic alone to warn users about something critical

  • Using <i> for icons

  • Treating <small> as a font-size tool or <mark> as a synonym for <strong>

  • Forgetting lang on foreign phrases inside <i>

Practise it in code

Interviewers rarely stop at the definition. These questions open in an editor with tests.

  1. Mark up a blog post with article, header, time, figure and a comment sectionEasy20 min
  2. Mark up a recipe page with semantic HTML onlyEasy15 minFree
  3. Audit a page's HTML for SEO mistakes: title, meta description, one <h1>, heading order, image alt, lang and canonicalEasy25 min