pinyin-to-bopomofo
pinyin-to-bopomofo offers a lightweight way to translate between pinyin (commonly used in mainland China) and bopomofo/zhuyin (commonly used in Taiwan).
Published July 31, 2025 (Updated July 31, 2025)

Translate between pinyin with tone marks (i.e. zhào), pinyin with numbers (i.e. zhao4), and bopomofo/zhuyin (i.e. ㄓㄠˋ).
This package is used in MandoFlow, the best way to learn Mandarin Chinese online by turning your favorite YouTube videos into interactive language learning lessons.
Repository: https://github.com/AustinShelby/pinyin-to-bopomofo
JSR: https://jsr.io/@austinshelby/pinyin-to-bopomofo
Installation
You can use pinyin-to-bopomofo
with both Deno and Node.js.
Deno
deno add jsr:@austinshelby/pinyin-to-bopomofo
Node.js
npx jsr add @austinshelby/pinyin-to-bopomofo
Quickstart
Translate between pinyin and bopomofo.
Translate between pinyin (tone numbers) and bopomofo.
Changelog
1.0.0
Release!