piapia123
en

Chinese to Pinyin

Text

Everything runs locally in your browser — nothing is uploaded

Input
Drop a file here to load its contents
Output

Convert Chinese text to pinyin. Three tone styles (`nǐ hǎo`, `ni3 hao3`, `ni hao`) and an initials mode (`nh`) are available, and punctuation, Latin words and digits are kept in place by default so the output lines up with the original sentence rather than being a run of letters with nothing to map back to. Polyphonic characters are resolved by word — the 行 in 银行 is háng while the one in 行走 is xíng — which is why this needs a 60,000-entry word list rather than a few spelling rules. That is also the one place this tool takes an external dependency: pinyin is a data table, not a rule set, and any hand-written approximation gets the common characters badly wrong.

Features

  • Three tone styles: marks (nǐ hǎo), numbers (ni3 hao3) and none (ni hao)
  • An initials mode producing joined-up initials (nhsj, not n h s j)
  • Polyphonic characters resolved by word: 银行 háng, 行走 xíng, 长城 cháng, 长大 zhǎng
  • Punctuation, Latin words and digits are kept by default, so the output lines up with the original
  • Or strip every non-Chinese character in one click when you want pinyin only
  • Spaces around Chinese punctuation are tidied (nǐ hǎo,shì jiè rather than nǐ hǎo , shì jiè)
  • Updates as you type and copies in one go
  • Caps out at 20,000 characters, refusing clearly rather than freezing the page
  • Everything runs locally in the browser; your text is never uploaded

How to use

  1. Paste the Chinese text
  2. Pick the output: full pinyin or initials only
  3. Pick a tone style
  4. Tick the non-Chinese removal when you want pinyin alone

FAQ

How are polyphonic characters handled?
By word, not by character. 银行 comes out yín háng and 行走 comes out xíng zǒu — the same character with two readings, and no amount of looking at it alone will tell you which. The tool uses the `pinyin-pro` word list (over 60,000 entries), which segments by longest match before looking up readings. A few proper nouns and classical usages can still be off; that is an inherent limit of this kind of tool.
Why does this tool download several hundred kilobytes?
Because that is how big the pinyin table is — over 60,000 entries, about 142 KB gzipped. It is the only external dependency here, and it was a deliberate trade: a hand-written rule-based approximation gets common characters wrong (polyphony has no rule to follow), and wrong pinyin makes the tool worthless. The weight is loaded per page: anyone not using this tool downloads none of it, and only opening this page fetches the data.
Why are the initials joined up?
Because "initials" in this context means the joined form (`nhsj`, the way an acronym looks). Spaced out as `n h s j` is defensible but reads as a row of separate letters rather than an abbreviation. If you need that, use full pinyin without tones and delete the spaces yourself.
Why is punctuation kept in the output?
Because keeping it lets you line the output up against the original. `nǐ hǎo,shì jiè` shows at a glance where the comma was; strip everything and you are left with a run of pinyin that no longer matches the original phrasing. Tick the removal option when you want bare pinyin. One detail: the library treats punctuation as non-Chinese and emits `nǐ hǎo , shì jiè` with the comma stranded between spaces, so this tool closes up the spaces around Chinese punctuation — only Latin punctuation keeps the space after it, because `Hello, world` should have one.
Is my text uploaded?
No. The conversion runs entirely in browser memory; the page makes no requests and works offline — the pinyin table ships inside the page own JavaScript.

Related tools