CSS writing-mode generator — vertical text for CJK layouts and side labels

Choose a writing mode and how characters are turned, preview it on mixed Japanese and English text, and copy a .vertical rule for vertical layouts or rotated side labels.

Live demo · real result from this tool

Press Generate to create a result.

Processed on your device — nothing is uploaded.

How to use the CSS writing mode generator

  1. Pick a writing-mode: horizontal-tb, vertical-rl, vertical-lr, sideways-rl or sideways-lr.
  2. Choose a text-orientation: mixed, upright or sideways.
  3. Tick Combine digits upright (text-combine-upright) if short numbers should sit across the line.
  4. Edit the Text to try your own words; the sample mixes Japanese, English and a year.
  5. Copy the .vertical rule, plus the .tcy rule if you ticked the option.

What it does and when to use it

writing-mode sets the direction in which lines of text run and stack. It is essential for vertical Japanese, Chinese or Korean layouts such as book pages, menus and posters. It is also handy in ordinary Latin designs: a vertical label along the edge of a card, a rotated column heading in a narrow table, or a magazine-style side caption, without the overlap problems of a CSS rotation.

For tilted text at angles other than 90°, use the CSS transform generator. To style the letters themselves, see the typography styler, and for decorative vertical headings, add an outline with the text stroke generator.

How it works

The rule always sets writing-mode. It adds text-orientation only when you pick something other than mixed, the default. With the combine option, it adds .vertical .tcy { text-combine-upright: all; }, and the preview wraps every run of one or two digits in such a span.

MDN lists writing-mode as Baseline widely available since March 2017, text-orientation since September 2020 and text-combine-upright since March 2022. That status covers the properties in general; individual values, such as the sideways modes or digits, have their own rows in MDN’s compatibility tables.

Worked examples

Classic vertical Japanese. The default, vertical-rl with mixed orientation: writing-mode: vertical-rl;. Kanji stand upright; the English words lie on their side.

Every character upright, with combined digits. vertical-rl, upright, combine ticked:

.vertical {
  writing-mode: vertical-rl;
  text-orientation: upright;
}
.vertical .tcy {
  text-combine-upright: all;
}

Wrap each number you want combined in <span class="tcy">; all squeezes the whole span into one character cell, so keep it to one or two digits.

A bottom-to-top spine label. sideways-lr gives writing-mode: sideways-lr; and the note “sideways-rl and sideways-lr have limited browser support (Firefox, and Chrome/Safari only in recent versions).”

Limits and tips

  • Width and height swap meaning. In vertical modes, the line length follows the height, so set a height or max-height on the element.
  • Punctuation and quotes may need a font with vertical forms to look right in CJK text.

Frequently asked questions

What is the difference between vertical-rl and vertical-lr?
Both run each line from top to bottom. With vertical-rl the first line is on the right and later lines move left, as in traditional Japanese, Chinese and Korean text. With vertical-lr the lines move from left to right.
What does text-orientation do?
It only matters in vertical modes. mixed keeps CJK characters upright and turns Latin letters on their side. upright stands every character up, so English reads letter by letter downwards. sideways turns everything on its side.
How do I make a vertical label read from bottom to top?
That is what sideways-lr is for. It is the look of a spine label or a rotated table header. The tool warns that sideways values have limited support, so check MDN's compatibility table before relying on them.
Why do my two-digit numbers not combine into one upright block?
The rule applies to elements with the class tcy, so wrap each short number in a span with that class, as the preview does. The generated value is all, because MDN states that the digits value is not supported in any browser.
Is rotating text with transform the same thing?
No. A transform only rotates the drawing; the box keeps its horizontal size, so it overlaps neighbours. writing-mode changes the layout itself, so the element takes up the space of vertical text.

Sources

  1. writing-mode - CSS | MDN — MDN Web Docs, accessed 2026-10-08
  2. text-orientation - CSS | MDN — MDN Web Docs, accessed 2026-10-08
  3. text-combine-upright - CSS | MDN — MDN Web Docs, accessed 2026-10-08

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close