piapia123
en

Chinese Typesetting

Text

Everything runs locally in your browser — nothing is uploaded

Input
Drop a file here to load its contents
Output

Paste Chinese text and get it typeset: gaps between Chinese and Latin, full-width punctuation where it belongs. The hard part is not the rules but not breaking anything — this edits your prose, and prose contains URLs, email addresses, inline code, decimals and thousands separators. So URLs, emails and backtick-quoted spans are protected wholesale, and the comma in `1,000` or the dot in `v1.2.3` is never touched. Each rule toggles independently: spacing, punctuation and ellipses are on by default, while straight-to-curly quotes is off — that one needs pairing, and a bad pairing damages the text, so it is your call.

Features

  • Spacing between Chinese and Latin, and between Chinese and digits, switchable separately (the pangu rules)
  • Half-width , ? ! : ; become full-width in Chinese context; punctuation in English sentences is left alone
  • Never touches a comma or dot between digits: 1,000 and v1.2.3 come out unchanged
  • URLs, emails and backtick-delimited inline code are protected wholesale
  • Trailing punctuation after a URL is treated as part of the sentence and still converts
  • Ellipses: three or more dots or full stops collapse to a single ……
  • Optional straight-to-curly double quotes; single quotes and apostrophes are never touched
  • Idempotent — running it twice changes nothing, which matters for a tool people re-run

How to use

  1. Paste your text; the result appears as you type
  2. Toggle the rules below and watch the result change
  3. Note that URLs, emails and backtick spans are deliberately left alone
  4. Copy the typeset text out

FAQ

Why no space after full-width punctuation?
Because a full-width glyph already fills its em — a `。` is as wide as a Chinese character and carries its own side bearings, so adding a space makes the line loose. `中文。abc` is therefore left as it is, while `中文abc` becomes `中文 abc`. This differs from pangu, whose Chinese range includes the full-width block but not the CJK punctuation block, so `中文,abc` gains a space while `中文。abc` does not — two sentence marks behaving differently, purely as an artefact of where the ranges were drawn.
Why is straight-to-curly quoting off by default?
Because it needs pairing, and pairing guesses. Only paired double quotes are converted; a lone quote is left exactly as it is, since guessing which side it belongs to damages the text when wrong. Single quotes are never touched at all: they double as apostrophes in English, and a pairing algorithm turns `don't` into `don‘t` — an error in precisely the place where errors are least acceptable.
Why is the full stop (.) not converted?
The two most common legitimate uses of `.` in Chinese prose are domain names and version numbers (`example.com`, `v1.2.3`), and those are already inside protected spans; whether a remaining bare `.` should become `。` is contested — some use it for abbreviations (`etc.`), others for list numbering (`1.`). Converting would break both, so this rule does not exist. Fixing a few by hand beats a tool guessing wrong.
Is the content of a URL really never touched?
Never. URLs, emails and backtick-quoted inline code are marked as uneditable ranges first, and the punctuation and ellipsis rules only run outside them. The one exception is punctuation that follows a URL at the end of a sentence: the comma in `见 https://a.com, 然后` belongs to the sentence, not to the URL, so it does convert — the matcher takes it greedily and then trims trailing punctuation from the end.

Related tools