The <ruby> element marks small annotations shown above, below, or beside base text — most often pronunciation help for East Asian characters (furigana, pinyin-style hints, and similar).
Put the base text inside <ruby>, then add <rt> for the annotation. Optional <rp> parentheses help when ruby layout is unavailable. Skip deprecated <rb> and <rtc>.
Baseline · Widely available.
Not deprecated. Core ruby support has been stable across browsers since about July 2015 (MDN).
Deprecated companions.
Do not use <rb> or <rtc> in new HTML. Put base text and <rt> directly in <ruby>, or nest <ruby> for two annotation sides.
Syntax
HTML Syntax
syntax.html
<ruby>base<rt>annotation</rt></ruby>
Both start and end tags are required. Nest groups of base text + <rt> (optionally with <rp> around each <rt>). Parent must accept phrasing content.
Reference
Attributes
<ruby> has no element-specific attributes — only globals. These patterns matter most in practice:
Nested ruby + ruby-position is the portable double-sided pattern.
How It Works
Inner ruby holds the base and the first annotation (e.g. kana).
Outer ruby wraps that unit and adds a second rt (e.g. English).
Set ruby-position so one side is over and the other under.
Prefer this over rtc for clearer cross-engine results.
Edge Cases & Pitfalls
Most ruby bugs come from legacy wrappers, missing language hints, or overcrowded annotations.
deprecated
Skip rb and rtc
Put base text and rt directly in ruby. See <rb> and <rtc> only for legacy recognition.
lang
Declare the base language
Set lang on ruby or an ancestor so assistive tech and fonts handle the script correctly.
fallback
Add rp when readers may lack ruby layout
Parentheses keep readings understandable as plain text. Harmless in modern ruby browsers.
a11y
Keep annotations short
Long glosses crowd the line. Prefer brief rt text; expand meaning in nearby prose when needed.
layout
Two sides need nesting + CSS
Use nested ruby with ruby-position. Do not rely on deprecated rtc for new pages.
Compatibility
Browser Support
The <ruby> element is core HTML phrasing content in modern browsers. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
<ruby>
Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera support basic ruby + rt. Nested / double-sided layout quality can still vary — test when you nest.
95%Global support (approx.)
Google ChromeAll modern
Full support
Mozilla FirefoxAll modern
Full support
Apple SafariAll modern
Full support
Microsoft EdgeAll modern
Full support
OperaAll modern
Full support
Samsung InternetAll modern
Full support
Internet ExplorerIE 10+ (partial)
Partial
<ruby>Widely supported
Bottom line: Safe for modern sites. Use ruby + rt (and optional rp); nest for two sides; skip rb and rtc.
Remember
Key Takeaways
Role:<ruby> wraps base text and small pronunciation (or gloss) annotations.
Children: use <rt>; add <rp> for fallback parentheses.
Two sides: nest ruby and place with ruby-position — not rtc.
One line: wrap base + <rt> in <ruby>; add <rp> when you want fallback parentheses.
UA style
Default CSS Settings
Typical user-agent mapping for ruby-related display values (engines may vary):
default.css
ruby {
display: ruby;
}
rt {
display: ruby-text;
font-size: 50%; /* often smaller than the base */
}
rp {
display: none; /* shown only when ruby layout is unavailable */
}
You can restyle with CSS (size, color, ruby-position). Prefer selectors on ruby and rt — not on deprecated rtc / rb.
Frequently Asked Questions
The ruby element wraps base text and small annotations (usually pronunciation) shown above, below, or beside the base — common for East Asian characters (furigana / pinyin-style hints).
Base text plus one or more rt annotations. Optionally wrap each rt with rp parentheses for fallback display. Do not use deprecated rb or rtc in new pages.
rp is optional but useful. It provides fallback parentheses when a browser cannot lay out ruby, so text still reads like 漢(かん).
No element-specific attributes. Use global attributes such as lang, class, and id. Set lang on ruby (or an ancestor) for the correct language of the base text.
Nest ruby elements and place each side with CSS ruby-position (over / under). Avoid deprecated rtc containers for new work.
No. ruby is Baseline and widely available (since about July 2015). Related legacy elements rb and rtc are deprecated — keep using ruby, rt, and rp.