Skip to content

<ruby> - The Ruby Annotation Element

Inline HTML5

The ruby annotation element represents small annotations rendered above, below, or next to base text, typically used for showing pronunciation of East Asian characters or providing translations.

Result
<ruby>
base text <rt>annotation</rt>
</ruby>

The <ruby> element contains base text and one or more <rt> (ruby text) elements for annotations.

A complete ruby annotation typically includes:

  • <ruby> - Container element
  • Base text - The main content being annotated
  • <rt> - Ruby text (the annotation)
  • <rp> - Ruby parentheses (optional, for fallback)
Result

Showing pronunciation of kanji characters:

Result
Result
Result
Result

Annotating multiple characters as a group:

Result
Result

The <rp> element provides fallback for browsers that don’t support ruby:

Result
Result
Result
Result
Result

Customize ruby annotation appearance:

Result
Result
Result
Result
BrowserVersionNotes
Chrome5+Full support
Firefox38+Full support
Safari5+Full support
Edge79+Full support
IE5.5+Partial support

Modern browsers have good support for ruby annotations. Use <rp> for fallback in older browsers.

Screen readers may read both the base text and the ruby annotation, which can be helpful for learning pronunciation.

Always specify the language for proper screen reader pronunciation:

<p lang="ja">
<ruby><rt></rt><rt>ほん</rt></ruby>
</p>

Too many annotations can be overwhelming:

<!-- Every character annotated -->
<ruby><rt>わたし</rt></ruby><ruby><rt></rt></ruby>...
LanguageUseExample
JapaneseFurigana for kanji<ruby>漢字<rt>かんじ</rt></ruby>
ChinesePinyin pronunciation<ruby>中文<rt>zhōngwén</rt></ruby>
KoreanHanja readings<ruby>韓國<rt>한국</rt></ruby>
AnyTranslation notes<ruby>text<rt>translation</rt></ruby>