HTML <rp> Tag

Beginner
6 min read
Updated: Nov 2026
4 examples
Live preview

Definition and Usage

The <rp> element provides fallback parentheses for browsers that cannot display <ruby> annotations. Put one <rp> before and one after the <rt> reading so limited UAs can still show something like 漢 (kan).

Supporting browsers hide the parentheses and draw the reading above or beside the base text. Use plain base text + rt + optional rp — skip deprecated <rb> and <rtc>.

Baseline · Widely available.

Not deprecated. Stable across browsers since about July 2015 (and earlier in practice).

Note.

<rp> must sit inside <ruby>, immediately before or after <rt>. Content is plain text — usually ( and ).

HTML Syntax

syntax.html
<rp> (</rp><rt>…</rt><rp>)</rp>

The end tag may be omitted if <rp> is immediately followed by <rt> or another <rp>, or when the parent ends. Beginners should write both tags for clarity.

Attributes

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

AttributeDescriptionNotes
None specificNo dedicated attributes on <rp> itself.Place rp next to rt inside ruby.

Global Attributes

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

Live Preview

Switch between real ruby markup (with rp) and a plain-text simulation of no ruby support.

Supporting browsers hide <rp>; others show the parentheses in the reading.

Annotation

漢 (kan) 字 (ji)

<rp>(</rp><rt>…</rt><rp>)</rp>

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Basic Fallback Parentheses

Wrap <rt> with opening and closing <rp>.

HTML
<ruby>
  漢
  <rp>(</rp><rt>kan</rt><rp>)</rp>
</ruby>
Try It Yourself

How It Works

  1. Open <ruby> and write the base character.
  2. Add <rp>(</rp> before the reading.
  3. Put the reading in <rt>.
  4. Close with <rp>)</rp> so fallback UAs show 漢 (kan).

Example 2 — Per-Character Annotations

Repeat the rp / rt / rp pattern for each base character.

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

How It Works

  1. Annotate the first character with its own rp/rt/rp group.
  2. Do the same for the next character.
  3. Without ruby support the line reads like 漢 (Kan) 字 (ji).
  4. With ruby support the parentheses stay hidden.

Example 3 — Whole-Word Reading

One reading for an entire word, still wrapped with fallback parentheses.

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

How It Works

  1. Put the full word as base text inside <ruby>.
  2. Open with <rp>(</rp>.
  3. Give one <rt> for the whole reading.
  4. Close with <rp>)</rp> for fallback clarity.

Example 4 — Same Annotation Without rp

Valid in modern browsers, but fallbacks lose the helpful parentheses.

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

How It Works

  1. Base + rt only is enough when ruby layout works.
  2. No rp means no automatic ( … ) in plain fallback.
  3. Prefer adding rp when you care about older or limited agents.
  4. Still avoid rb / rtc — they are deprecated/legacy.

Edge Cases & Pitfalls

Most rp mistakes are wrong placement, missing the closing paren, or mixing in deprecated ruby tags.

order

Keep rp next to rt

Place <rp> immediately before and/or after <rt> inside <ruby>. Do not scatter parentheses elsewhere in the sentence.

pair

Use opening and closing marks

Typical pattern is <rp>(</rp> … <rp>)</rp>. One side alone makes fallback text harder to read.

content

Text only inside rp

Permitted content is text (the parenthesis characters). Do not nest other elements in rp.

legacy

Do not revive rb / rtc

rp is current; rb and rtc are deprecated/legacy. Stick to ruby + rt + rp.

Browser Support

The <rp> element is core HTML for ruby fallback. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

<rp>

Widely available since about July 2015. Supporting browsers hide rp; others show the parentheses around the reading text.

96% Global support (approx.)
Google Chrome All modern
Full support
Mozilla Firefox All modern
Full support
Apple Safari All modern
Full support
Microsoft Edge All modern
Full support
Opera All modern
Full support
Samsung Internet All modern
Full support
Internet Explorer 5+
Supported
<rp> Widely supported

Bottom line: Safe to include with every ruby annotation. Supporting engines hide the marks; everyone else still gets readable parentheses.

Key Takeaways

  • Role: <rp> stores fallback parentheses around <rt>.
  • Pattern: <rp>(</rp><rt>…</rt><rp>)</rp> inside ruby.
  • Display: supporting browsers hide rp; others show the marks.
  • Modern set: ruby + rt + rp — not rb / rtc.

One line: wrap each <rt> with <rp>(</rp> … <rp>)</rp> for readable ruby fallbacks.

Default CSS Settings

Typical behavior in browsers that support ruby (parentheses are not shown):

default.css
rp {
  display: none;
}

Engines without ruby layout treat rp more like normal text, so the ( and ) appear inline with the reading.

Frequently Asked Questions

The rp element holds fallback parentheses around ruby text (rt). Browsers that cannot show ruby layout display those parentheses so the reading still looks clear, for example 漢 (kan).
Usually no. Supporting browsers hide rp and draw the reading above or beside the base text. rp is for older or limited user agents.
Inside ruby, immediately before and after the rt element: <rp>(</rp><rt>…</rt><rp>)</rp>.
Not required for the annotation to work in modern browsers, but recommended so fallback rendering stays readable.
No. It is Baseline and widely available. Deprecated pieces of the ruby model are rb and rtc — not rp.
Yes in HTML when rp is immediately followed by rt or another rp, or when the parent has no more content. Beginners can write both tags for clarity.

Next: rt

Mark the ruby reading text with the HTML rt element.

rt 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