Count characters, words, Chinese characters, effective characters (excluding spaces and newlines), lines, and punctuation marks in your text
The Word Counter is a text analysis tool designed for writers, students, editors, and developers. It quickly computes several key metrics for any text: total character count, English word count, Chinese character count, effective character count (excluding whitespace), line count, and punctuation count.
Whether you need to meet a word count requirement for an article, analyze the line count of a code file, or examine the character composition of a translated document, this tool delivers precise results in an instant. All counting happens locally in your browser — no data is ever uploaded, ensuring your privacy is fully protected.
This tool employs regular expression matching and character classification under UTF-8 encoding. Chinese characters are identified using the Unicode CJK Unified Ideographs block (U+4E00 – U+9FFF). English words are matched through continuous alphanumeric sequences, and punctuation is counted using the Unicode Punctuation property (\p{P}) for comprehensive coverage.
Line counting is achieved by splitting on newline characters (\n, \r\n, \r). The effective character count is calculated by stripping all whitespace characters (spaces, line breaks, tabs, etc.) and measuring the remaining string length. All counts use mb_* functions to ensure correct handling of multi-byte characters such as Chinese, Japanese, and Korean.
Input text:
Hello World!
This is a test sentence.
It contains Chinese, English, punctuation, and 123 numbers.
Output results:
Total Characters: 91
Word Count: 11
Chinese Characters: 6
Effective Characters (no whitespace): 79
Line Count: 3
Punctuation Count: 9
The Word Counter belongs to the text processing category, alongside Text Diff. In document review workflows, they can be used together. If you need to handle specially-encoded text, try URL Decoder or Unicode Encoder first. For data analysis scenarios, URL Params to Table and Base64 Decoder are also commonly-used companion tools.