JAVASCRIPT / TYPESCRIPT LIBRARY
Chinese text
to pinyin initials
Pyfl is a JavaScript library that turns 喵 into M and 世界 into SJ. Add search by initials to titles and contact lists, or type Chinese here and copy the result.

Type Chinese. Get pinyin initials.
The result updates as you type and is ready to copy. English, numbers, and symbols stay unchanged.
Conversion runs in this browser. Your input is not sent to a server.
Built-in phrase rules turn 重庆银行 into CQYH and 音乐 into YY. Unmatched text uses default character readings; names and places may need custom rules.
Same character. Different words.
Compare the same dictionary with and without phrase rules. Select a word to try it above.
| Word | Character only | With phrases |
|---|---|---|
ZQ | CQ | |
ZL | ZL | |
YX | YH | |
XZ | XZ | |
YL | YY | |
KL | KL |
You are reading the static version. Enable JavaScript to type, search, and copy.
Search Chinese titles by their initials.
Search these sample titles with CQ or ZQ for 重庆银行, YY or YL for 音乐收藏夹, or enter Chinese text.
Search matches Chinese text and consecutive initials across pronunciation candidates. Rare readings may also match; a result does not confirm pronunciation. Full pinyin and skipped-letter matching are not supported.
7 titles
- 魔法少女喵喵酱
MFSNMMJ - 周末去看海
ZMQKH - 月亮邮局
YLYJ - 给未来的自己
GWLDZJ - 夏日观察日记
XRGCRJ - 重庆银行
CQYH - 音乐收藏夹
YYSCJ
Use Pyfl in your project
Install the package and import the converter. Choose an ESM, CommonJS, or browser example below.
npm install pyflimport pyfl from "pyfl/modern";
pyfl("你好,世界"); // "NH,SJ"
pyfl("重庆银行 / 音乐 / 行走"); // "CQYH / YY / XZ"This playground uses the modern phrase mode of pyfl 2.1.0, available on npm. Usage documentation
Conversion uses pyfl/modern; lookup uses multi-pronunciation search. Rebuild existing indexes when switching entries. Modern entry guide
- 01Common characters & phrases
- The common dictionary covers 8,105 characters with 36 built-in phrase rules. Unlisted characters, emoji, and symbols are preserved.
- 02Initials only
- Phrase rules use longest matching, without general contextual disambiguation or full pinyin. Use createConverter overrides for names, places, and special readings.
- 03Whitespace & types
- Empty strings and ASCII-space-only strings return empty. Other whitespace is preserved. Non-strings use template-string coercion.
SMALL LETTERS, LITTLE WONDERS.