An old browser, or a reader displaying HTML without a stylesheet dedicated to ruby, runs into a <ruby> composition and has no idea how to position the annotation above the text: with no fallback, it risks showing the pronunciation glued to the word, with no separation at all, unreadable.
<rp> exists for exactly this case: it provides fallback parentheses, invisible in a browser that handles ruby correctly, but shown as plain text everywhere else to keep a readable result.
Definition
<rp> holds a punctuation character, almost always an opening or closing parenthesis, meant for browsers unable to render a <ruby> composition correctly. It is always used in pairs, one before the <rt> annotation, one after, and only makes sense inside a <ruby> tag.
Its mechanism rests on a simple contrast: a browser that understands ruby entirely ignores the content of <rp> and positions the annotation visually in the right place, while a browser that does not understand it shows all the text in sequence, parentheses included, which stays readable even without any particular styling.
Used in pairs around rt
<ruby>
漢字
<rp>(</rp><rt>かんじ</rt><rp>)</rp>
</ruby>The first <rp> holds an opening parenthesis, placed right before rt. The second holds the closing parenthesis, placed right after. Without ruby support, the result shown on screen becomes 漢字(かんじ), perfectly readable as plain text.
Invisible in a browser that supports ruby
On a browser that correctly handles ruby, a default style rule hides all the content of <rp>, since the annotation already has its place, above the base text, with no need for parentheses to stand out visually. Users never see these parentheses on an up-to-date modern browser, which explains why the tag is often discovered late, even by people who have read annotated HTML for years.
A common trap is skipping <rp> on the assumption that it is purely decorative since it never shows on a recent browser. Without it, a browser lacking ruby support shows the annotation glued to the base text with no separation at all, which makes the result unreadable for anyone not benefiting from ruby rendering.
Best practices
Systematically adding a pair of <rp> around every <rt> costs two small tags and changes nothing for the vast majority of visitors, who use a recent browser where they stay invisible. In return, it guarantees readable text for the rare cases where support is missing, with no dependency on any condition or technical detection.
Checking the result without ruby support
The simplest way to check that a pair of <rp> is doing its job is to copy the annotated text into a plain text editor, with no styling at all: the result should stay readable exactly as is, parentheses included, without depending on a particular browser to make sense of the sentence. This quick test immediately reveals an oversight, for instance a single <rp> placed instead of the full pair, which would leave an orphan parenthesis in the fallback text.
Frequently asked questions
Is <rp> required for a ruby composition to work?
No, a <ruby> composition works perfectly well without it on a browser that supports ruby. It still comes strongly recommended as a safety net for older browsers or text readers that know nothing about ruby, where its absence makes the annotation unreadable.
Can something other than a parenthesis go inside <rp>?
Nothing technically forbids it, but the parenthesis stays the near-universal convention since it produces a readable result in any language without adding extra meaning. Another punctuation character would remain valid, provided the opening and closing pair stays consistent.
Is the content of <rp> read by screen readers?
It depends on the screen reader and its support for ruby: some ignore it like a modern browser, others read it along with the rest of the text. That very uncertainty is why the content should stay a plain parenthesis, never information essential to understanding.