Skip to main content
Tools

Pangu Spacing

Automatically add spaces between Chinese and English text or digits, with every change highlighted and Markdown and code kept intact.

0 characters · 1 line

0 characters · 1 line

Changes

How to use

  1. Paste text that mixes Chinese and English into “Input text”, or click “Example”.
  2. “Result” instantly adds half-width spaces between Chinese characters and Latin letters, digits and symbols. Click “Copy” to use it.
  3. “Changes” shades and underlines every added space and strikes through removed characters, with a count of each above.
  4. For Markdown or text with code, keep “Keep Markdown and code syntax” checked so code and link URLs are left alone.

FAQ

Why add spaces between Chinese and English?

A half-width space between Chinese characters and Latin letters or digits makes word boundaries easier to see, and many Chinese style guides and technical writing guides recommend it. This tool uses the rules of the open-source pangu.js library.

What exactly does it change?

Mostly it inserts spaces between CJK characters (Chinese, Japanese kana and Bopomofo) and Latin letters, digits and half-width symbols. pangu also removes stray spaces just inside brackets and quotes, and in a few cases turns a half-width colon into a full-width one. No space is added next to full-width punctuation such as ,。「」. Note that a word followed by a bracket also gets a space, so rgb(0 0 0) in a Chinese sentence becomes rgb (0 0 0); wrap code in backticks (`) to keep it as is.

What does “Keep Markdown and code syntax” do?

Fenced code blocks (``` or ~~~) are left untouched. Inline code keeps its content, though spaces are still added around it. Link and image URLs, <https://…> autolinks and reference-definition URLs are kept as is. Bold, italic and strikethrough markers stay attached to their text instead of turning into broken syntax like “** bold”. Code blocks indented by four spaces cannot be detected reliably, so wrap code in ``` instead.

Are URLs, emails and HTML tags split up?

No. Even without the Markdown option, pangu keeps http:// and https:// URLs, email addresses and HTML tags intact and only adds spaces between them and Chinese text.

Does it work for Korean?

No. pangu only handles Chinese, Japanese kana and Bopomofo; Korean (Hangul) is left as is.

Is my data uploaded?

No. Everything runs in your browser, with no network connection needed.

Keyboard shortcuts

/
Search tools (on a tool page, goes to the homepage search)
?
Show this help
Esc
Close a dialog
Ctrl / ⌘Enter
Run the tool's main action (where supported)

While you type in a text field, / and ? are typed as usual.