References

Beginner-friendly references for web development, with live, editable examples.

The HTML <ruby> tag

Element All modern browsers Updated
Quick answer

The HTML <ruby> element wraps text with ruby annotations — small notes (like pronunciation) shown above or beside base characters, common in Japanese (furigana) and Chinese typography. The annotation goes in <rt>, with <rp> as a fallback.

Overview

The <ruby> element provides ruby annotations — short runs of text, typically pronunciation guides, displayed alongside base characters. It is most associated with East Asian typography, where readings are shown above or beside characters.

Inside it, the base text is followed by an <rt> holding the annotation, and optional <rp> elements supply fallback parentheses for browsers that cannot render ruby positioning.

Keep the annotations short — they are meant as compact reading aids, not full explanations. For most Western content you will never need it, but for Japanese furigana, Chinese pinyin and similar, it is the correct, accessible tool.

Syntax

<ruby>漢 <rp>(</rp><rt>kan</rt><rp>)</rp></ruby>

Example

Live example
<p><ruby>東京 <rp>(</rp><rt>Tōkyō</rt><rp>)</rp></ruby></p>

Best practices

  • Pair each base run with an <rt> annotation inside the <ruby>.
  • Include <rp> fallback parentheses for non-supporting browsers.
  • Use it for pronunciation guides like furigana or pinyin, not general annotations.
  • Keep annotations short — they are compact reading aids.

Frequently asked questions

What is the ruby element?
It displays ruby annotations — small pronunciation or meaning guides — alongside base text, common in East Asian typography.
What is ruby used for?
Pronunciation guides such as Japanese furigana or Chinese pinyin shown next to the base characters.
What are rt and rp?
<rt> holds the annotation text; <rp> provides fallback parentheses for browsers without ruby support.
Is the ruby element widely supported?
Basic ruby is well supported in current browsers; the <rp> fallback covers any that are not.