mojimoji
A fast converter between Japanese hankaku and zenkaku characters
What it is and what it does
mojimoji is a Cython-based library for converting Japanese text between hankaku (half-width) and zenkaku (full-width) character forms. It provides two main functions: zen_to_han() converts full-width characters to half-width, and han_to_zen() does the reverse. Both functions accept optional flags to control whether kana, digits, and ASCII characters are converted, allowing fine-grained control over which character classes are affected.
The package is designed for speed and has no runtime dependencies, installing via pre-built wheels for Python 3.7–3.12 on major platforms. Maintenance is dormant (last release 2024-01-12), but the codebase is stable and the repository remains accessible.
Use it for:
- Normalize Japanese user input in web forms or data pipelines to a consistent character width.
- Prepare Japanese text for search indexing or matching where width variations should be treated as equivalent.
- Convert legacy half-width Japanese data to full-width for display or compatibility with modern systems.
- Process Japanese text in NLP or text analysis workflows where character width normalization is a preprocessing step.
- Handle Japanese text in databases or APIs where width consistency is required for data integrity.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts Japanese text between hankaku (half-width) and zenkaku (full-width) character representations using Cython for speed.
Yes, if you need to convert between Japanese character widths. The package is stable, dependency-free, and widely used. The dormant maintenance is not a blocker for a mature, single-purpose tool with no external dependencies. Install it if Japanese text normalization is part of your workflow; skip it if you don't work with Japanese text.
Install
mojimoji on PyPI
pip
pip install mojimojiuv
uv add mojimojipoetry
poetry add mojimojiInstalling mojimoji
Before you install
Medium install friction due to compiled wheels; pre-built binaries available for Python 3.7–3.12 on macOS, Linux, and Windows, so installation should succeed without compilation on most platforms. Maintenance is dormant—last release was 2024-01-12, though the repository remains active and the package is stable.
License in practice
Licensed under Apache License (permissive), so you can use, modify, and distribute the package freely with minimal restrictions.
Quickstart
pip install mojimoji
import mojimoji
print(mojimoji.zen_to_han('アイウabc012'))
# Output: アイウabc012
print(mojimoji.han_to_zen('アイウabc012'))
# Output: アイウabc012
Requires Python 3.7 or later; installation relies on pre-built wheels for common platforms.
Verify before relying
- Whether the package handles combining characters or other Unicode edge cases in Japanese text.
- Performance characteristics on very large text volumes or streaming scenarios.
- Whether dormant maintenance affects long-term compatibility with future Python versions beyond 3.12.
- Current adoption and usage patterns in production systems.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 945 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 375,150/month — #7,141 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mojimoji-0.0.13-cp310-cp310-macosx_10_9_x86_64.whl; mojimoji-0.0.13-cp310-cp310-macosx_11_0_arm64.whl; mojimoji-0.0.13-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl; mojimoji-0.0.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; mojimoji-0.0.13-cp310-cp310-win32.whl; mojimoji-0.0.13-cp310-cp310-win_amd64.whl; mojimoji-0.0.13-cp311-cp311-macosx_10_9_x86_64.whl; mojimoji-0.0.13-cp311-cp311-macosx_11_0_arm64.whl; mojimoji-0.0.13-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl; mojimoji-0.0.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; mojimoji-0.0.13-cp311-cp311-win32.whl; mojimoji-0.0.13-cp311-cp311-win_amd64.whl; mojimoji-0.0.13-cp312-cp312-macosx_10_9_x86_64.whl; mojimoji-0.0.13-cp312-cp312-macosx_11_0_arm64.whl; mojimoji-0.0.13-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl; mojimoji-0.0.13-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; mojimoji-0.0.13-cp312-cp312-win32.whl; mojimoji-0.0.13-cp312-cp312-win_amd64.whl; mojimoji-0.0.13-cp37-cp37m-macosx_10_9_x86_64.whl; mojimoji-0.0.13-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Keywords: japanese
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
habachenHabachen converts between full-width and…
permissive · top 15,000 on PyPI
jaconvjaconv converts between Japanese character…
permissive · top 5,000 on PyPI
kanjizeConverts between Japanese kanji number…
permissive · top 15,000 on PyPI
pykakasiTransliterates Japanese text (hiragana,…
copyleft · top 5,000 on PyPI
wetextNormalizes and denormalizes text in Chinese,…
permissive · top 15,000 on PyPI
unidicProvides the UniDic 2.3.0 Japanese…
permissive · top 15,000 on PyPI
pyopenjtalkWraps OpenJTalk to provide Japanese…
permissive · top 15,000 on PyPI
anyasciiConverts Unicode text to ASCII-only equivalents…
permissive · top 5,000 on PyPI
misakiConverts written text to phonetic…
permissive · top 15,000 on PyPI
fugashiA Cython wrapper for MeCab that tokenizes and…
permissive · top 5,000 on PyPI