# hotoo/pinyin

:cn: 汉字拼音 ➜ hàn zì pīn yīn

Repository: https://github.com/hotoo/pinyin
Canonical: https://ross.abutalabs.com/products/pinyin
Homepage: https://pinyin.js.org
Language: JavaScript
License: MIT
License Family: permissive
Topics: pinyin, chinese, zhongwen, hanzi
Last push: 2026-06-09T09:54:41+00:00

## Health v2 (maintenance only)
Score: 62/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 86, release rhythm 8, longevity 100
- inputs: {"age_days": 5880, "days_push": 85, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 7828, forks 851 (observed 2026-08-28T04:10:05.469661+00:00)

## What it is
A JavaScript library that converts Chinese characters (Hanzi) to Pinyin, supporting multiple pinyin styles, heteronym (polyphonic) characters, surname mode, and optional word segmentation. It ships as an npm package usable in Node and browsers, plus a companion CLI tool.

## Use cases
- convert chinese characters to pinyin
- sort chinese text by pinyin
- add pinyin annotations to hanzi
- get first letters of chinese words for search indexing
- resolve polyphonic chinese characters with word segmentation
- convert chinese names to pinyin with surname handling

## When to choose
- you need Chinese-to-Pinyin conversion in Node.js or the browser
- you need multiple pinyin styles, heteronyms, or surname mode
- you want a CLI for quick pinyin conversion

## When to avoid
- you need a Python implementation (use python-pinyin instead)
- you need full traditional Chinese or translation features beyond pinyin conversion

## Facets
- artifact type: library
- maturity: active
- function: nlp, parser, cli, internationalization
- domain: developer-tools
- platform: browser, cli, cross-platform
- tags: pinyin, chinese, hanzi, text-conversion, segmentation, monorepo, natural-language-processing, localization, command-line, nodejs

## Member repositories
- hotoo/pinyin (main) score 62

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:05.469661+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:34:03.598003+00:00, confidence not recorded.
  - readme: https://github.com/hotoo/pinyin (fetched 2026-08-28T04:10:05.469661+00:00, sha d2b954c37e17)
  - homepage: https://pinyin.js.org (fetched 2026-08-29T08:30:53.511508+00:00, sha 31090eb55e69)
  - registry_npm: https://registry.npmjs.org/pinyin (fetched 2026-08-29T08:30:53.520724+00:00, sha b2ae1a32e392)
- Data as of 2026-08-30T08:39:29.467469+00:00.
