HTML: Ruby Tag

By Xah Lee. Date: . Last updated: .

HTML5 has {ruby, rt, rp} tags. These are used for pronunciation markup. Mostly used in Japanese and Chinese.

html ruby annotation 60465
Example of Ruby annotation rendered. (with custom CSS for font size and coloring)

かんじ , hàn, ㄏㄢˋㄗˋ

English Example

Here's what your browser shows:

passé /paˈsā/

Here's the HTML code:

<ruby class="ruby44235">passé <rt>/paˈsā/</rt></ruby>

Here's the CSS code:

ruby.ruby44235 {color:green; font-size:xx-large}
ruby.ruby44235 rt {color:red}

Japanese Example

Here's what your browser shows:


HTML code:


Chinese Example

Here's what your browser shows:

hàn, ㄏㄢˋㄗˋ

HTML code:

<p><ruby class="ruby44235">汉<rt>hàn</rt>字<rt>zì</rt></ruby>,
<ruby class="ruby44235">漢<rt>ㄏㄢˋ</rt>字<rt>ㄗˋ</rt></ruby></p>

[see Pinyin 拼音, Zhuyin 注音, IPA Comparison]

The 「rp」 Tag

The “rp” tag is used to add parenthesis around the pronunciation symbols for browsers that do not support ruby.


<ruby class="ruby44235">
xyz <rp>(</rp><rt>abc</rt><rp>)</rp>

what your browser shows: xyz (abc)

Browser Support

As of , browsers that support ruby annotation are: {Google Chrome, Firefox, Safari, IE9}.

As of , browsers that support ruby annotation are: {Google Chrome, Safari, IE9}.

HTML Basics

  1. HTML Basics
  2. HTML5 Tags
  3. Case Sensitivity
  4. Allowed Characters
  5. Charset and Encoding
  6. Self-Closing Tags
  7. Multiple Class Value
  8. HTML Entity List

HTML Table

  1. HTML Table Examples
  2. HTML Table, thead, tbody, tfoot
  3. HTML Table, colgroup, col
  4. Styling HTML Table with CSS
  5. CSS: 3 Columns Page Layout
  6. Pure CSS Table


  1. Viewport Meta
  2. the Root Element
  3. iframe
  4. video
  5. audio
  6. figure
  7. dl, dt, dd
  8. s strike del
  9. time
  10. meter
  11. progress
  12. q
  13. address
  14. canvas
  15. ruby
  16. HTML5 Custom Data Attribute
  17. Big Tag
  18. Image Maps
  19. Marquee, Scrolling Text
  20. How to Markup Subtitle
  21. Meta Language Tag Obsolete
  22. Browser Auto Refresh

HTML4 Frameset

  1. HTML: Split Windows; Frameset
  2. HTML Nested Frameset

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials