HTML

HTML Text Formatting: Bold, Italic, Strong, and Em

Bold, italic, strong and em in HTML: which tags only change how text looks, which ones carry meaning, and when to use each.

RazakTerra
Reading time
2 min read
Comments
Discussion
HTML Text Formatting: Bold, Italic, Strong, and Em
On this page
  1. Strong and Bold
  2. Emphasis and Italic
  3. Other Useful Text Tags
  4. Highlight text
  5. Smaller Text
  6. Quick Comparison
  7. Simple Example
  8. Quick Tips

Strong and Bold

Playground
<strong>This text is important</strong> <b>This text is bold</b>
Result
Cmd/Ctrl + Enter runs it · Esc leaves the editor
  • <strong> → Makes text bold and tells browsers/screen readers that the content is important.
  • <b> → Only makes the text bold visually, without adding extra meaning.

Use <strong> when the text really matters. Use <b> if you just want the bold style.

Emphasis and Italic

Playground
<em>This text is emphasized</em> <i>This text is italic</i>
Result
Cmd/Ctrl + Enter runs it · Esc leaves the editor
  • <em> → Puts emphasis on the text (usually shown as italic) and has semantic meaning.
  • <i> → Only makes the text italic, mostly for visual style (like technical terms or foreign words).

Other Useful Text Tags

Highlight text

Hightlight Text
<p>You need to install <mark>Node.js</mark> first.</p>
Result
Cmd/Ctrl + Enter runs it · Esc leaves the editor

The <mark> tag highlights text (usually with a yellow background).

Smaller Text

Playground
<p>Price: $20 <small>(excluding tax)</small></p>
Result
Cmd/Ctrl + Enter runs it · Esc leaves the editor

The <small> tag makes text smaller. It’s often used for side notes or fine print.

Quick Comparison

Tag Visual Effect Semantic Meaning Best Used For
<strong> Bold Importent content Warnings, key points
<b> Bold None Styling only
<em> Italic Emphasis Stressing a word or phrase
<i> Italic None Names, terms, foreign words
<mark> Highlighted Relevant/marked text Search results, key highlights
<small> Smaller text Side comments Notes, disclaimers

Simple Example

Playground
<p>
  Please read the <strong>terms and conditions</strong> carefully before signing
  up. The offer is only valid until <mark>30 September</mark>.
  <small>Terms may change without notice.</small>
</p>

<p>
  The word <i>café</i> comes from French, and you should <em>never</em> skip the
  accent.
</p>
Result
Cmd/Ctrl + Enter runs it · Esc leaves the editor

Quick Tips

Prefer <strong> and <em> when the meaning matters (better for accessibility and SEO). Use <b> and <i> only for pure styling. Don’t use these tags just to make text look nice use CSS if you only care about appearance. You can combine tags if needed, for example: <strong> <em>Very important </em> </strong>.

Understanding the difference between visual style and semantic meaning helps you write cleaner and more meaningful HTML.

Written by

Razak

Writes about the web, slowly, and builds small tools on the side.

Discussion

Comments

Loading comments…

Keep reading