Input
Result
The result will appear here.Chinese technical writing reads better with a space between Chinese and Latin text — 在 GitHub 上有 1000 个 star rather than 在GitHub上有1000个star — and with full-width punctuation inside Chinese sentences. This tool applies both: the spacing comes from pangu.js, the library behind the widely used pangu browser extension, and the punctuation rules from the chinese-copywriting-guidelines that many Chinese open-source projects follow. Code spans, fenced code blocks, URLs, e-mail addresses, Markdown link targets and HTML tags are set aside first and put back unchanged, so a README can be run through as a whole.
How it works
- A space is added between Chinese characters and Latin letters or digits on either side, and nowhere else: text that is only English is left as it is.
- After Chinese text, , : ; ! ? become ,:;!?, a full stop becomes 。, ... becomes ……, and parentheses around Chinese become (); spaces around full-width punctuation are removed.
- Full-width letters and digits such as ABC123 are turned into ordinary ones.
- Switch punctuation fixing off to add the spaces only.
Where your data goes
Nowhere. This tool runs entirely in your browser: the text you paste is processed by the page and is never transmitted to a server or written to a log.
This tool is free and needs no account. Its results exist only in your open page and are not saved anywhere.
What it costs
This tool is free, with no sign-in and no points.
Common questions
- Why add spaces between Chinese and English at all?
- It is a typographic convention rather than a grammar rule, but a widespread one in technical writing: the gap makes the Latin words stand out and the text easier to scan. It is recommended by the chinese-copywriting-guidelines and by many companies' own Chinese style guides, and it is how most Chinese open-source documentation is written.
- Will it break my code?
- Not code in backticks or fenced blocks — those are protected and returned byte for byte, as are URLs, e-mail addresses and Markdown link targets. Code written as plain text is not recognised: in 调用foo(bar)函数 pangu also spaces the bracket, giving 调用 foo (bar) 函数. Put code in backticks and it is left alone.
- Does it change English punctuation?
- Only when it directly follows Chinese text. Hello, world! stays as it is; 你好,世界! becomes 你好,世界!. A comma between two English words inside a Chinese sentence is left half-width.
The open-source behind it
This tool runs on vinta/pangu.js, released under MIT. If you need the same behaviour inside your own program, that is the library to reach for.
vinta/pangu.jsAlso known as
- pangu spacing
- chinese english spacing
- 中英文空格
- 盘古之白
- chinese copywriting guidelines
- 中文排版