Character and word counter
Live counts of characters, Chinese characters (Script=Han), English words, lines, UTF-8 bytes and whitespace, each with its own clearly stated rule for mixed Chinese/English text.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Statistics
Every figure is recomputed as you type; the rule behind each one is listed below.
Enter text to calculate statistics
Characters: 0 · Chinese characters: 0 · English words: 0 · Lines: 0 · UTF-8 bytes: 0 · Whitespace: 0
What this tool does
- Check the Chinese-character count (not the raw character count) against a submission limit
- Measure how many English words a mixed Chinese/English paragraph contains
- Check the UTF-8 byte size before storing text in a fixed-length database column
Example
Input
你好 world 😀
Output
10 characters · 2 Chinese chars · 1 words · 17 bytes
Ten code points including the space and newline, two Chinese characters, one English word and 17 bytes: 你好 6 + space 1 + world 5 + newline 1 + 😀 4.
Frequently asked questions
How are Chinese characters counted?
Every code point whose Unicode Script property is Han counts once — that is the figure Chinese publications and papers mean by "word count". Traditional Chinese and Japanese kanji are Han too and are included, while Chinese punctuation such as ,。! is not Han and is excluded.
How do "English words" differ from the character count?
Words are runs of ASCII letters and digits, optionally joined by ' ’ or - (so don't and well-known each count once). Chinese, Japanese, Cyrillic and other scripts never count as words. The character count, by contrast, counts every Unicode code point including punctuation and spaces.
How many characters is an emoji?
Counting is by code point, so 😀 is one character and four UTF-8 bytes, while composite emoji such as 👨👩👧 are several code points and therefore several characters. That is inherent to the code-point rule and differs from the "one emoji" people perceive.
How are newlines and blank lines handled?
Lines are the segments split by \r\n, \n or \r: empty text is 0 lines, "a\nb" is 2 lines, and "a\n" is also 2 lines because the trailing empty segment counts. Whitespace counts code points matched by \s, including spaces, tabs and newlines.
Keywords:character counterword countutf-8 bytes