HTML <rb> Tag

Beginner
6 min read
Updated: Nov 2026
4 examples
Deprecated

Definition and Usage

The <rb> element once marked each base text segment inside a <ruby> annotation — the characters being annotated (often East Asian text with readings).

Learn it only to recognize legacy markup and migrate it. For new pages, put the base characters directly inside <ruby>, annotate with <rt>, and optionally add <rp> fallback parentheses. Skip <rtc> as well (also legacy).

Deprecated.

Do not use <rb> in new projects. Prefer <ruby> + <rt> (+ optional <rp>) without an rb wrapper.

Note.

One <rb> was meant for each atomic base segment you wanted to pair with an <rt>. Opening tags alone were common; browsers filled in the rest when allowed by the parser rules.

HTML Syntax

syntax.html
<ruby><rb> base</rb><rt>reading</rt></ruby>

Only valid as a child of <ruby>. The end tag may be omitted if <rb> is immediately followed by <rt>, <rtc>, <rp>, or another <rb>, or when the parent has no more content.

Attributes

The <rb> element has no element-specific attributes — only global attributes.

AttributeDescriptionNotes
None specificNo dedicated attributes on <rb> itself.Deprecated element. Prefer modern ruby / rt markup.

Global Attributes

The <rb> tag also supports the Global Attributes in HTML.

Live Preview

Compare legacy <rb> markup with the modern pattern (same reading on screen in supporting browsers).

Prefer the modern pattern for new pages. Legacy is for recognition only.

Annotation

漢kan字ji

<ruby>漢<rt>kan</rt>字<rt>ji</rt></ruby>

HTML Examples

Legacy markup for study, then the patterns you should write today. Use Try It Yourself for a live editor.

Example 1 — Legacy rb Segments (Study Only)

Historical pattern: one <rb> per base character, then matching <rt> readings.

HTML
<!-- Deprecated — for study only -->
<ruby>
  <rb>漢</rb><rb>字</rb>
  <rp>(</rp><rt>kan</rt><rt>ji</rt><rp>)</rp>
</ruby>
Try It Yourself

How It Works

  1. Open <ruby> as the annotation wrapper.
  2. Wrap each base piece in <rb> (here 漢 and 字).
  3. Add matching <rt> readings for those segments.
  4. Optional <rp> shows parentheses when ruby layout is unavailable.

Example 2 — Modern ruby (No rb)

Put base text directly in <ruby> and annotate with <rt>.

HTML
<ruby>
  漢<rt>kan</rt>字<rt>ji</rt>
</ruby>
Try It Yourself

How It Works

  1. Skip <rb> entirely.
  2. Write the base character as text inside <ruby>.
  3. Follow it with <rt> for that reading.
  4. Repeat for the next base + reading pair.

Example 3 — Modern with rp Fallback

Add <rp> so plain-text fallbacks still show parentheses around the reading.

HTML
<ruby>
  明日
  <rp>(</rp><rt>Ashita</rt><rp>)</rp>
</ruby>
Try It Yourself

How It Works

  1. Place the whole word as base text inside <ruby>.
  2. Open with <rp>(</rp> for fallback UAs.
  3. Put the reading in <rt>.
  4. Close with <rp>)</rp>. Supporting browsers hide the parentheses.

Example 4 — Separate Annotations (No rb)

Annotate each character in its own base + rt group — still without rb.

HTML
<ruby>
  漢 <rp>(</rp><rt>Kan</rt><rp>)</rp>
  字 <rp>(</rp><rt>ji</rt><rp>)</rp>
</ruby>
Try It Yourself

How It Works

  1. Write the first base character, then its rp/rt/rp group.
  2. Repeat for the next character the same way.
  3. No <rb> is required to separate the segments.
  4. This matches modern MDN guidance for per-character annotations.

Edge Cases & Pitfalls

Most rb issues today are using it in new code or mixing old and new ruby models.

deprecated

Do not ship new rb markup

Even if a browser still parses it, the feature is deprecated. Teach and write ruby + rt instead.

parent

Only inside ruby

<rb> is not a general wrapper. Outside <ruby> it has no useful meaning.

rtc

Avoid rtc with it

Complex ruby containers are also legacy. Keep new annotations to ruby, rt, and rp.

support

Support is inconsistent

Some engines treat unknown or deprecated ruby pieces loosely. Relying on rb pairing is fragile — another reason to migrate.

Browser Support

The <rb> element is deprecated HTML. Do not depend on it for new work. Modern ruby / rt / rp are the supported path.

✓ Deprecated

<rb>

Marked deprecated on MDN. Browsers may still parse ruby layouts that include rb, but behavior is legacy and not a reason to author new rb markup.

Legacy Status for new sites
Google Chrome Legacy / limited
Deprecated
Mozilla Firefox Legacy / limited
Deprecated
Apple Safari Legacy / limited
Deprecated
Microsoft Edge Legacy / limited
Deprecated
Opera Legacy / limited
Deprecated
Samsung Internet Legacy / limited
Deprecated
Internet Explorer Partial (legacy)
Deprecated
<rb> Deprecated — avoid

Bottom line: Recognize rb in old documents, then rewrite with ruby + rt (+ optional rp). Do not use rb in new HTML.

Key Takeaways

  • Status: <rb> is deprecated — study legacy pages, do not write new ones.
  • Replace: base text + <rt> inside <ruby>, no rb wrapper.
  • Fallback: optional <rp> parentheses for non-ruby UAs.
  • Also skip: <rtc> belongs with the same legacy ruby model.

One line: recognize <rb>, then annotate with <ruby> and <rt> only.

Default CSS Settings

rb has no meaningful dedicated UA stylesheet of its own. Ruby layout comes from the parent:

default.css
ruby {
  display: ruby;
}
rb {
  /* no special default styling beyond ruby participation */
  display: ruby-base;
}

Exact display values and pairing behavior vary by engine. Prefer styling ruby and rt in modern documents.

Frequently Asked Questions

Yes. MDN marks rb as deprecated. Do not use it in new projects. Put base text directly inside ruby and annotate with rt (and optional rp).
It wrapped each base-text segment inside a ruby annotation — the characters being annotated (for example kanji shown with furigana).
Use ruby with the base characters as direct content, plus rt for the reading. Add rp parentheses for browsers that do not show ruby layout.
In the old model, yes — one rb segment per annotation you wanted to match. Modern markup pairs base text with rt without rb wrappers.
In HTML, the end tag may be omitted when rb is immediately followed by rt, rtc, rp, or another rb, or when the parent ends. Prefer writing both tags if you must read legacy examples.
Yes historically. rtc (ruby text container) is also obsolete/legacy. Prefer ruby + rt + rp for new documents.

Next: rp

Add fallback parentheses for ruby annotations with the HTML rp element.

rp tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful