HTML text formatting lets you style words and phrases inside paragraphs—bold, italic, highlighted, struck-through, and more. These inline elements change appearance and, when you choose semantic tags, add meaning that helps screen readers and search engines understand your content.
Understanding formatting tags is essential for readable, accessible web pages. This tutorial covers the most common tags, when to use each one, and how to combine them safely.
What You’ll Learn
01
strong / b
Bold text.
02
em / i
Italic text.
03
mark
Highlight.
04
del / ins
Edits.
05
Nesting
Combine tags.
06
a11y
Semantic HTML.
Fundamentals
What Is HTML Text Formatting?
HTML text formatting refers to inline elements that wrap part of a sentence or heading to change its style or meaning. Unlike block elements (like <p> or <h1>) that start on a new line, formatting tags flow inside existing text.
Tags fall into two groups:
Semantic — convey meaning (<strong>, <em>, <mark>, <del>, <ins>).
Presentational — change look only (<b>, <i>, <u>).
💡
Beginner Tip
When in doubt, pick the semantic tag. <strong> instead of <b> and <em> instead of <i> helps everyone—including users who cannot see bold or italic styling.
Reference
Common Text Formatting Tags
Here are the most widely used HTML text formatting elements:
<small> — side comments, fine print, or legal text.
<del> — deleted (struck-through) content.
<ins> — inserted (underlined) content.
<sub> / <sup> — subscript and superscript (H2O, x2).
Comparison
Semantic vs Presentational Tags
Visual effect
Semantic (preferred)
Presentational
Bold
<strong> — important
<b> — style only
Italic
<em> — stress
<i> — alternate voice
Underline
<ins> — inserted text
<u> — unarticulated annotation
Strikethrough
<del> — removed text
<s> — no longer accurate
Browsers style these tags by default, but you can override appearance with CSS. Semantic meaning stays even if you change fonts or colors.
Emphasis
Styling Text for Emphasis
Use <strong>, <em>, and <mark> to draw attention while adding meaning:
html
<p>This is a <strong>bold statement</strong> with
<em>italic emphasis</em> and <mark>highlighted text</mark>.</p>
strong — key point or warning.
em — spoken stress on a word.
mark — search hit or newly relevant phrase.
Semantics
Structuring Content with Semantic Tags
Semantic tags help assistive technology and search engines interpret your page:
html
<p><strong>Important:</strong> Always validate user input.</p>
<p>She <em>really</em> loves coding.</p>
Screen readers may pronounce <em> with different intonation. <strong> signals that the label “Important” is more than decoration—it introduces critical information.
Nesting
Combining Text Formatting Tags
Nested tags combine effects. Open and close in reverse order (like stacking boxes):
html
<p>This is <strong><em>very important</em></strong> text.</p>
Result: bold and italic. Keep nesting shallow—two levels is usually enough.
Edits
Showing Edits with del and ins
When content changes over time, <del> and <ins> document what was removed and added:
small shrinks legal or secondary notes. u underlines without implying a link.
Example 6 — Complete HTML Page
A full page demonstrating the main formatting tags together:
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML Text Formatting Example</title>
</head>
<body>
<h1>HTML Text Formatting Example</h1>
<p>This is an example of <strong>bold text</strong>,
<em>italic text</em>, and <u>underlined text</u>.</p>
<p>You can also <mark>highlight text</mark> or use
<small>smaller text</small>.</p>
<p><del>Deleted text</del> and <ins>inserted text</ins>
are also supported.</p>
</body>
</html>
Matches the classic tutorial conclusion—open Try It to edit and preview every tag in the browser.
Applications
🚀 Common Use Cases
Warnings and tips — <strong>Note:</strong> before critical instructions.
Product pages — del + ins for old and new prices.
Search results — mark around matched keywords.
Documentation — show edits with del and ins.
Legal footnotes — small for disclaimers.
Science & math — sub and sup for formulas.
🧠 How Text Formatting Works in HTML
1
Write paragraph
Start with <p> or a heading element.
Block
2
Wrap words
Add inline tags around the phrase to format.
Inline
3
Browser styles
Default CSS makes strong bold, em italic, etc.
Render
=
📝
Readable content
Formatted text with optional semantic meaning for SEO and a11y.
Pro Tips
💡 Best Practices
✅ Do
Use strong and em for meaningful emphasis
Use del / ins for real document changes
Keep nesting shallow (one or two levels)
Override default styles with CSS when branding requires it
Link to detailed tag pages for deep dives
❌ Don’t
Bold entire paragraphs for “design”—use headings or CSS
Use u for navigation links
Rely on bold/italic alone to convey critical info
Stack more than two or three inline tags
Use formatting tags for page layout (use CSS instead)
Compatibility
Universal Browser Support
All text formatting tags listed here are part of HTML5 and supported in every modern browser. Default styling (bold, italic, strikethrough) works without CSS.
✓ Baseline · Since HTML
Text formatting tags
All text formatting tags listed here are part of HTML5 and supported in every modern browser. Default styling (bold, italic, strikethrough) works without CSS.
99%Modern browser support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
Text formatting tagsExcellent
Bottom line: Safe to use everywhere. Customize appearance with CSS; semantic roles remain in the DOM.
Wrap Up
Conclusion
HTML text formatting gives you simple, built-in tools to emphasize words, highlight search terms, and show edits. Choose semantic tags when meaning matters, nest carefully, and keep accessibility in mind.
For deeper coverage of individual elements, explore strong, em, and mark. Next, learn how to add non-displayed notes with HTML comments.
HTML text formatting means using inline elements like strong, em, mark, and del inside paragraphs and headings to change how text looks and what it means. Tags wrap words or phrases—you do not need CSS for basic bold, italic, or highlight effects.
Both often appear bold visually. strong adds semantic importance—use it for warnings, key terms, or critical info. b is presentational only; use it when bold is purely decorative (e.g. a product name in a list) and strong would mislead assistive tech.
em indicates stressed emphasis and may change how screen readers speak the word. i is for alternate voice or mood (foreign words, technical terms, thoughts) without strong stress. Prefer em when emphasis matters for meaning.
The u element underlines text. In modern UI, underlines usually mean links, so use u sparingly—spelling corrections, proper names in Chinese, or legal text. For links, use the a element instead.
del marks deleted content (old price, removed step). ins marks newly inserted content. Together they show document revisions—useful for changelogs, edited articles, and version history.
Yes. Nest tags inside out: <strong><em>very important</em></strong> produces bold italic text. Close tags in reverse order. Avoid deep nesting—it hurts readability for humans and screen readers.
Did you know?
Before CSS was widely used, authors relied on <font> and <center> for styling. HTML5 removed many presentational tags in favor of semantic elements plus CSS. Text formatting tags like strong and em survived because they describe meaning, not just appearance.