Character Type
A classification of the characters that make up text. Categories such as hiragana, katakana, kanji, Latin letters, digits, and symbols form the basic units for input validation and text analysis.
Character type refers to the classification of characters in a text based on their properties. Japanese text is notable for its exceptional diversity of character types: hiragana, katakana, kanji, full-width alphanumerics, half-width alphanumerics, full-width symbols, and half-width symbols can all appear within a single sentence. This diversity is the root cause of the complexity involved in Japanese text processing.
Unicode classifies character types through the "General Category" property. The seven major categories are Letter, Mark, Number, Punctuation, Symbol, Separator, and Other, each further divided into subcategories. Both kanji and hiragana fall under "Lo" (Letter, other), which means the Unicode category alone cannot distinguish between them.
To identify Japanese character types, Unicode blocks (code point ranges) are used. Hiragana occupies U+3040 to U+309F, katakana U+30A0 to U+30FF, and CJK Unified Ideographs U+4E00 to U+9FFF as the primary ranges. In regular expressions, /[\u3040-\u309F]/ matches hiragana and /[\u30A0-\u30FF]/ matches katakana. When extended blocks (Katakana Phonetic Extensions, Kana Extended-A and B, and CJK Unified Ideographs Extension A through J as of Unicode 17.0, released in September 2025) are taken into account, the ranges expand considerably.
Form validation is a representative use of character-type restrictions: "full-width katakana only" for name readings, "half-width alphanumerics only" for passwords, and "digits only" for phone numbers. A challenge specific to Japanese is the coexistence of full-width digits "123" and half-width digits "123", or full-width katakana "カ" and half-width katakana "カ". Normalizing these (e.g., converting full-width to half-width) before validation absorbs the mixed forms.
In text analysis, the ratio of character types serves as an indicator of a text's characteristics. A high proportion of kanji conveys density and formality, while a high proportion of hiragana gives a softer, more readable impression. One guideline passed down among editors is to keep kanji to around 30% and use hiragana for most of the rest, but this is an empirical rule rather than a measured standard, and in real text that includes katakana words and alphanumerics, kanji and hiragana together do not add up to 100%.