Stable 1.4.0 · 穩定版 C, C++, Node.js, Python Open source · 開源

Open Chinese Convert 開放中文轉換

A precise conversion engine for Traditional Chinese, Simplified Chinese, Japanese Kanji, variants, and regional wording across Mainland China, Taiwan, and Hong Kong. 精準處理繁體、簡體、日本新字體、異體字,以及中國大陸、台灣、香港地區用詞差異的中文轉換引擎。

Convert with OpenCC 使用 OpenCC 轉換 s2twp.json

Input / 輸入

汉字、鼠标、数据库连接池

Output / 輸出

漢字、滑鼠、資料庫連線池

npm install opencc
opencc -c s2twp.json -i input.txt -o output.txt
CMake Bazel MSVC Node.js CI Python CI AppVeyor npm package PyPI version Debian package

Install / 安裝

Use it from your platform of choice 選擇你慣用的平台安裝

Node.js

Package and CLI 套件與命令列工具

npm install opencc opencc-jieba
npm install -g opencc opencc-jieba
Python

Python package Python 套件

pip install opencc
macOS

Homebrew

brew install opencc
Windows

WinGet

winget install opencc

Conversion model / 轉換模型

Pure rule-based Chinese conversion without LLM dependency 不依賴大模型的純規則中文轉換

Phrase-level conversion 詞彙級轉換

Handles vocabulary and idiom differences instead of only replacing individual characters.處理詞彙與慣用語差異,而不只是逐字替換。

Variant-aware rules 異體字規則

Separates one-to-many Traditional Chinese mappings from variant character mappings.嚴格區分「一簡對多繁」與異體字映射。

Regional dictionaries 地區詞庫

Supports Mainland China, Taiwan, Hong Kong, and Japanese Shinjitai conversion profiles.支援中國大陸、台灣、香港與日本新字體轉換配置。

Extensible data 可擴展資料

Dictionary data is separate from the library so teams can import, replace, and extend rules.詞庫與函式庫分離,方便導入、替換與擴展規則。

Open code, dictionaries, and configs 代碼、字典、配置完全開放

All core assets are transparent and editable, making conversion behavior auditable and reproducible.核心代碼、轉換字典與配置文件全部開放,轉換行為可審查、可復現、可自訂。

Documentation / 文檔

API references and release artifacts API 參考與發佈檔案

Read the generated API documentation, browse historical versions, or inspect the source on GitHub.查看自動生成的 API 文檔、歷史版本,或在 GitHub 檢視原始碼。