CJK Language Codes — Chinese, Japanese, and Korean
Guide to language codes for Chinese, Japanese, and Korean including script subtags, regional variants, and encoding considerations.
Detailed Explanation
CJK Language Codes
Chinese, Japanese, and Korean (CJK) languages share some Unicode character ranges but have distinct language codes and unique localization requirements.
Chinese Language Tags
Chinese is complex because it uses two different scripts and has many regional variants:
| Tag | Meaning |
|---|---|
zh |
Chinese (generic) |
zh-Hans |
Chinese, Simplified script |
zh-Hant |
Chinese, Traditional script |
zh-CN |
Chinese as used in mainland China |
zh-TW |
Chinese as used in Taiwan |
zh-HK |
Chinese as used in Hong Kong |
zh-Hans-CN |
Simplified Chinese, China |
zh-Hant-TW |
Traditional Chinese, Taiwan |
zh-Hant-HK |
Traditional Chinese, Hong Kong |
Best practice: Use script subtags (Hans/Hant) rather than relying on region alone, because the script is the primary differentiator for content and font selection.
Japanese Language Tags
| Tag | Meaning |
|---|---|
ja |
Japanese |
ja-JP |
Japanese, Japan |
ja-Latn |
Japanese in Latin script (romaji) |
Japanese uses four scripts simultaneously: kanji (漢字), hiragana (ひらがな), katakana (カタカナ), and romaji (Latin). The default tag ja implies the standard mixed-script writing.
Korean Language Tags
| Tag | Meaning |
|---|---|
ko |
Korean |
ko-KR |
Korean, South Korea |
ko-KP |
Korean, North Korea |
While Hangul (한글) is the primary script, some contexts mix Hanja (Chinese characters). South and North Korean differ in vocabulary, spelling rules, and Romanization.
Font and Rendering Considerations
CJK fonts are significantly larger than Latin fonts (often 5-20 MB). Strategies include:
/* Use font-display: swap for CJK web fonts */
@font-face {
font-family: "Noto Sans JP";
font-display: swap;
src: url("/fonts/NotoSansJP.woff2") format("woff2");
}
/* CSS font stacks for CJK */
:lang(ja) {
font-family: "Noto Sans JP", "Hiragino Kaku Gothic Pro",
"Yu Gothic", sans-serif;
}
:lang(zh-Hans) {
font-family: "Noto Sans SC", "PingFang SC",
"Microsoft YaHei", sans-serif;
}
:lang(ko) {
font-family: "Noto Sans KR", "Apple SD Gothic Neo",
"Malgun Gothic", sans-serif;
}
Line Breaking and Text Spacing
CJK text has different word-breaking rules. CSS properties like word-break, overflow-wrap, and text-spacing-trim are important for proper CJK typography.
Use Case
Any application targeting East Asian markets needs proper CJK language codes. E-commerce platforms, gaming localization, social media apps, and enterprise software all require correct script subtag usage to serve the right content and fonts to users in China, Japan, Korea, Taiwan, and Hong Kong.
Try It — Language Code Reference
Related Topics
Script Subtags (Hans vs Hant) — Distinguishing Writing Systems
Standards
BCP 47 Language Tags — The Web Standard for Locale Identifiers
Standards
Right-to-Left (RTL) Languages — Codes and Web Implementation
Internationalization
Language Tags in HTML — The lang Attribute Guide
Web Development
Intl API Locale Codes — JavaScript Internationalization
Web Development