What it does
nkf is a command-line filter for Japanese encodings and Unicode, with input detection, kana conversion and line-folding options.
Choose the target encoding explicitly when converting older Japanese text with nkf, and use its encoding guess as a clue rather than a guarantee. Conversion also affects character forms: the default changes halfwidth kana to fullwidth forms, while -x preserves the documented kana forms. BOM, byte order and line endings have separate controls. Unassigned characters are skipped by default unless a fallback is selected. Both --in-place and --overwrite replace original listed files; the latter preserves timestamps. Review those choices before using either mode.
Strengths
- Japanese encoding detection and conversion
- Kana and fullwidth-character controls
Watch out for
- Default kana conversion can alter character forms
Best for
- Preparing older Japanese text for Unicode use
Sources
- nkf - Network Kanji Filter (Oct 26, 2026)
- nkf: Network Kanji Filter | Official repository (Oct 26, 2026)