HTML provides special tags to format text — to make it bold, italic, underlined, and more. These tags give text meaning and visual style.
Both tags make text bold, but they have different semantic meanings:
<b>This text is bold (no extra meaning).</b>
<strong>This text is important (semantic bold).</strong>
| Tag | Meaning | Rendered As |
|---|---|---|
<b> | Bold — visual only, no semantic meaning | Bold text |
<strong> | Strong importance — screen readers emphasize this | Strong text |
<i>This text is italic (visual only).</i>
<em>This text is emphasized (semantic italic).</em>
| Tag | Meaning | Rendered As |
|---|---|---|
<i> | Italic — visual only (e.g. technical terms) | Italic text |
<em> | Emphasis — screen readers stress this word | Emphasized text |
<u>This text is underlined.</u>
<s>This text is no longer accurate.</s>
<del>This text has been deleted.</del>
The <ins> tag marks text that has been inserted into a document (shown with underline):
<p>My favorite color is <del>blue</del> <ins>red</ins>.</p>
My favorite color is blue red.
<p>Do not forget to <mark>buy milk</mark> today.</p>
Do not forget to buy milk today.
Superscript text appears half a character above the normal line — used for footnotes, exponents, ordinals:
<p>2<sup>10</sup> = 1024</p>
<p>The 1<sup>st</sup> of January</p>
210 = 1024
The 1st of January
Subscript text appears half a character below the normal line — used in chemical formulas:
<p>H<sub>2</sub>O (Water)</p>
<p>CO<sub>2</sub> (Carbon Dioxide)</p>
H2O (Water)
CO2 (Carbon Dioxide)
<p>Normal text. <small>This is small text.</small></p>
Normal text. This is small text.
| Tag | Description | Example Output |
|---|---|---|
<b> | Bold (visual) | Bold |
<strong> | Important/bold (semantic) | Strong |
<i> | Italic (visual) | Italic |
<em> | Emphasized/italic (semantic) | Emphasised |
<u> | Underline | Underline |
<s> | Strikethrough (inaccurate) | |
<del> | Deleted text | |
<ins> | Inserted text | Inserted |
<mark> | Highlighted text | Highlighted |
<sup> | Superscript | 210 |
<sub> | Subscript | H2O |
<small> | Smaller text | Small text |
<strong> over <b> and <em> over <i> — they carry semantic meaning that helps screen readers and search engines understand your content.