HTML <rp> Tag

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 3 Examples
HTML Text

What You’ll Learn

The <rp> tag provides fallback parentheses in ruby annotations for East Asian typography. This guide covers syntax, use with ruby and rt, browser support, and best practices for beginners.

01

Fallback Text

Parentheses role.

02

Inside ruby

With rt element.

03

Syntax Order

Before and after rt.

04

Hidden When OK

Ruby-capable UAs.

05

East Asian

Reading aids.

06

Accessible

Graceful fallback.

What Is the <rp> Tag?

The <rp> tag is an HTML element designed to provide fallback parentheses for browsers that do not support the display of ruby annotations. It is used inside the <ruby> element, wrapping punctuation around <rt> (ruby text) so non-supporting browsers still show readable annotations.

Valid HTML5 — Ruby Parentheses Element

When ruby layout works, browsers hide rp and show rt above the base characters. When it does not, users see something like 漢(kan).

Use rp together with ruby and rt for pronunciation or translation hints in Japanese, Chinese, Korean, and other East Asian content.

📝 Syntax

Place rp before and after rt to supply fallback parentheses:

syntax.html
<ruby><rp>(</rp><rt>kan</rt><rp>)</rp>
</ruby>

Syntax Rules

  • Always nest rp and rt inside a ruby element.
  • Use one rp for the opening parenthesis and one for the closing parenthesis.
  • Put meaningful text inside rtrp only holds fallback punctuation.
  • Do not use deprecated rb or rtc in new documents.

⚡ Quick Reference

TopicCode SnippetNotes
Basic pattern<rp>(</rp><rt>...</rt><rp>)</rp>Inside ruby
Parent element<ruby>Required wrapper
Annotation text<rt>Reading hint
AttributesNoneGlobal only
Ruby-capable UArp hiddenrt shown above
Browser supportModern fullIE 10+ partial

⚖️ <rp> vs <rt>

ElementRoleVisible when ruby works?
<rp>Fallback parenthesesNo (hidden)
<rt>Annotation textYes (above base)
<ruby>Container for bothYes

🧰 Attributes

The <rp> tag does not support any specific attributes. Its primary function is to act as a container for fallback parentheses.

None

No tag-specific attributes. Only global HTML attributes such as class apply.

<rp>(</rp>
class CSS

Optional styling when customizing fallback display.

class="ruby-fallback"

Examples Gallery

Wrap rt annotations with rp fallback parentheses inside ruby elements.

👀 Live Preview

Basic ruby annotation with rp fallback:

(kan)

📚 Common Use Cases

The <rp> tag is used within ruby annotations to provide a text fallback for browsers that do not support ruby layout.

Ruby Annotations

The primary use of rp is within ruby annotations to provide fallback parentheses around rt text.

ruby-annotations.html
<ruby><rp>(</rp><rt>kan</rt><rp>)</rp>
</ruby>
Try It Yourself

Japanese Reading Aid

Multi-character base text with rt and rp for place names or vocabulary.

japanese-reading.html
<ruby>
  東京 <rp>(</rp><rt>とうきょう</rt><rp>)</rp>
</ruby>
Try It Yourself

♿ Accessibility

  • Include rp fallback — Ensures annotations remain readable without ruby layout support.
  • Use meaningful rt text — The annotation should clearly convey pronunciation or meaning.
  • Set lang attribute — Declare lang="ja" or the correct language on the page or element.
  • Pair with ruby and rt — Never use rp alone outside a ruby context.

🧠 How <rp> Works

1

Author adds rp around rt

Opening and closing rp elements wrap the rt annotation.

Markup
2

Ruby-capable browser hides rp

The user agent displays rt above the base characters.

Render
3

Fallback browser shows parentheses

Users without ruby support see base(rt) inline text.

Fallback
=

Readable in every browser

Ruby annotations stay accessible whether or not layout is supported.

Browser Support

The <rp> tag is supported in all modern browsers. Internet Explorer 10 and later has partial ruby support.

Baseline · HTML5

Ruby fallback everywhere

Modern browsers hide <rp> and render <rt> annotations correctly inside <ruby>.

100% Modern browsers
Google Chrome Fully supported
Full support
Mozilla Firefox Fully supported
Full support
Apple Safari Fully supported
Full support
Microsoft Edge Fully supported
Full support
Internet Explorer IE 10+ · Partial
Partial
Opera Fully supported
Full support
<rp> tag 100% modern · IE partial

Bottom line: Use <rp> with ruby and rt for reliable ruby annotation fallbacks.

Conclusion

The <rp> tag might seem subtle, but its role in providing fallback parentheses within ruby annotations is significant. Incorporating this tag into your HTML markup ensures a consistent and accessible presentation of ruby text across various browsers.

💡 Best Practices

✅ Do

  • Use rp with ruby and rt
  • Include meaningful fallback parentheses
  • Set lang for East Asian content
  • Test annotations in multiple browsers

❌ Don’t

  • Use rp outside a ruby element
  • Put annotation text inside rp instead of rt
  • Skip rt when adding rp
  • Use deprecated rb or rtc wrappers

Key Takeaways

Knowledge Unlocked

Six truths every developer should know about <rp>

Bookmark these before you add ruby annotations.

6
Core concepts
🌸 02

Inside ruby

Required parent.

Structure
📝 03

Wraps rt

Before and after.

Syntax
👁 04

Hidden

When ruby works.

Behavior
🌎 05

East Asian

Reading aids.

Context
🌐 06

Full Support

Modern browsers.

Compatibility

❓ Frequently Asked Questions

It provides fallback parentheses around rt text when ruby layout is not supported.
Before and after rt, typically as <rp>(</rp><rt>...</rt><rp>)</rp>.
No tag-specific attributes. It only holds fallback punctuation or text.
No. Ruby-capable browsers hide rp and display rt above the base text.
Yes in all modern browsers. IE 10+ has partial ruby support.

Add Ruby Fallback Parentheses

Practice <rp> with ruby and rt in the Try It editor.

Try ruby annotation →

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.

6 people found this page helpful