Skip to content

Chinese Number to Words JavaScript

3 Chinese locales — Simplified, Traditional, and Cantonese.

LocaleVariantScript
zh-CNSimplified Chinese简体
zh-TWTraditional Chinese繁體
yue-HKCantonese (Hong Kong)繁體

Install

bash
npm install to-words

Basic Conversion

js
import { ToWords } from 'to-words';

const tw = new ToWords({ localeCode: 'zh-CN' });
tw.convert(12345); // "一万二千三百四十五"

Formal Characters (大写 / Anti-fraud)

js
tw.convert(12345, { formal: true }); // "壹万贰仟叁佰肆拾伍"

FAQ

Q: What is the formal option for Chinese?
A: Formal characters (大写, dàxiě) are used in banking, invoicing, and legal documents to prevent fraud. Pass { formal: true }.

Q: Is Cantonese (yue-HK) different from Mandarin zh-TW?
A: They share script but use different numerals/vocabulary in some cases.

Released under the MIT License.