Chinese Text Vertical to Horizontal Converter
Convert Chinese text between vertical (直書) and horizontal (橫書) writing styles, plus fullwidth-halfwidth conversion. Free online tool.
About
Traditional Chinese, Japanese, and Korean texts use vertical writing (直書, tategaki): columns flow top-to-bottom, ordered right-to-left. Modern digital systems default to horizontal writing (橫書, yokogaki): rows flow left-to-right, top-to-bottom. Converting between these layouts is not a simple transpose. Column padding, punctuation orientation, and fullwidth character alignment must be preserved. A naive approach that ignores trailing whitespace or mixes halfwidth Latin characters with fullwidth CJK glyphs produces broken output with misaligned columns. This tool implements the correct padding and reading-order logic, plus bidirectional fullwidth - halfwidth conversion using the Unicode offset 0xFEE0 between codepoint ranges U+FF01 - U+FF5E and U+0021 - U+007E.
Limitations: vertical output is a monospaced text approximation. True vertical rendering requires CSS writing-mode properties. This converter produces the traditional plain-text column format used in terminals, print typesetting, and legacy systems where CSS is unavailable. Punctuation rotation (e.g., turning 「」 brackets) is not applied; the tool preserves original codepoints. For mixed CJK-Latin text, halfwidth Latin characters occupy half the width of fullwidth CJK characters, which may cause column misalignment in non-monospaced fonts.
Formulas
The fullwidth-to-halfwidth conversion relies on a constant Unicode offset. For any fullwidth character Cfw in the range U+FF01 - U+FF5E, the corresponding halfwidth character Chw is computed as:
For the ideographic space U+3000, the mapping is a special case to ASCII space U+0020. The reverse (halfwidth to fullwidth) applies the inverse addition.
The horizontal-to-vertical algorithm distributes N characters across columns of height h. The number of columns c required is:
Characters are placed column-first: character at index i goes to column j = floor(i ÷ h) and row r = i mod h. Output rows are then printed with columns ordered right-to-left (reversed) to match traditional reading order.
The vertical-to-horizontal algorithm reverses this process. Each input line is treated as a row of the column grid. Characters are read by iterating columns (right-to-left in the source, meaning last character index to first per row) and then rows (top-to-bottom), reconstructing the original linear text stream. Trailing padding spaces (fullwidth U+3000 or halfwidth U+0020) are stripped.
Where Cfw = fullwidth character codepoint, Chw = halfwidth character codepoint, N = total character count, h = column height, c = number of columns, i = character index, j = column index, r = row index.
Reference Data
| Character Type | Halfwidth Range | Fullwidth Range | Offset | Example Half | Example Full |
|---|---|---|---|---|---|
| Exclamation - Tilde | U+0021 - U+007E | U+FF01 - U+FF5E | 0xFEE0 | A | A |
| Space | U+0020 | U+3000 | 0x2FE0 | (space) | (ideographic space) |
| Digits 0-9 | U+0030 - U+0039 | U+FF10 - U+FF19 | 0xFEE0 | 5 | 5 |
| Latin Uppercase | U+0041 - U+005A | U+FF21 - U+FF3A | 0xFEE0 | Z | Z |
| Latin Lowercase | U+0061 - U+007A | U+FF41 - U+FF5A | 0xFEE0 | z | z |
| CJK Unified Ideographs | U+4E00 - U+9FFF | N/A (already fullwidth) | - | 中 | |
| CJK Punctuation | U+3000 - U+303F | N/A | - | 、。〈〉 | |
| Halfwidth Katakana | U+FF65 - U+FF9F | U+30A1 - U+30F6 | Variable | ア | ア |
| Hangul Compatibility Jamo | U+FFA0 - U+FFDC | U+3131 - U+3163 | Variable | ᄀ | ㄱ |
| Fullwidth Won Sign | U+20A9 (₩) | U+FFE6 (₩) | 0xDF3D | ₩ | ₩ |
| Vertical Writing Direction | Top→Bottom, Right→Left (columns) | 直書 | |||
| Horizontal Writing Direction | Left→Right, Top→Bottom (rows) | 橫書 | |||
| CSS writing-mode: vertical-rl | Native browser vertical rendering | CSS3 | |||
| CSS writing-mode: horizontal-tb | Default browser horizontal rendering | CSS3 | |||
| Ideographic Space Width | Equal to one CJK character width (1em) | ||||