Online Word Counter: Count Words, Characters, Lines Instantly
What Is Word Counting
Word counting (Word Counter / Character Counter) calculates text metrics like word count, character count, line count, and paragraph count. It's essential for technical writing, SEO optimization, and everyday development.
Why You Need Word Counting
- SEO and length planning: In-depth posts often land around 1500–2500 words — use the counter against section budgets, not as an excuse to pad
- Technical writing: Keep docs concise enough to finish the job
- Social media: Twitter/X 280-character limit, Weibo 140-character limit
- Academic papers: Strict length rules — confirm whether the venue means characters or words
- Code review: Control commit message and PR description length
- API design: Cross-check field limits with UTF-8 byte length
Chinese vs English Counting
Chinese and English have fundamentally different counting mechanics. ToolVault's Word Counter follows a Word/WPS-style rule and shows the breakdown:
| Metric | English "Hello World" | Chinese "你好世界" |
|---|---|---|
| Characters (with spaces) | 11 | 4 |
| Characters (no spaces) | 10 | 4 |
| Whitespace chars | 1 | 0 |
| Words (CJK + Latin) | 2 | 4 (each character = 1 word) |
| UTF-8 bytes | 11 | 12 (3 bytes per character) |
Why Chinese Characters Use More Bytes?
In UTF-8 encoding:
- English letters: 1 byte each
- Chinese characters: 3 bytes each
- Emoji: 4 bytes each
That is why a Chinese character takes 3 bytes on disk. The tool also reports UTF-8 bytes so you can check database VARCHAR limits, HTTP body caps, or SMS billing.
How This Tool Counts
- Characters: Unicode code points (one emoji = 1, not two UTF-16 units); with-spaces / without-spaces listed separately, plus an explicit whitespace count
- Words: each Han, kana, or Hangul syllable counts as one word; Latin/digit runs split on spaces (hyphens and apostrophes stay inside the token, e.g.
state-of-the-art,don't) - Lines and paragraphs: physical lines (including blanks) vs non-empty lines; paragraphs split on blank lines
- Reading time: about 400 CJK characters/minute + 200 Latin words/minute; blank input is 0 minutes, any real content is at least 1
How to Use an Online Word Counter
Using ToolVault's Word Counter:
- Paste text into the input area
- View real-time statistics:
- Characters (with/without spaces), whitespace, UTF-8 bytes
- Words, plus CJK characters and Latin/digit words
- Lines, non-empty lines, sentences, paragraphs
- Estimated reading time
- Supports mixed East Asian and Latin text; everything runs locally in the browser
Word Counting in Code
The samples below match this site's convention (do not whitespace-split alone — pure CJK would count as one word).
JavaScript
function analyzeTextStats(text) {
const normalized = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
const cjk = (normalized.match(
/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/gu
) || []).length;
const latin = (normalized.match(/[A-Za-z0-9][A-Za-z0-9'’-]*/g) || []).length;
let chars = 0;
let noSpace = 0;
for (const ch of normalized) {
chars += 1;
if (!/\s/u.test(ch)) noSpace += 1;
}
const lines = normalized ? normalized.split('\n').length : 0;
const nonEmptyLines = normalized
? normalized.split('\n').filter((l) => l.trim()).length
: 0;
const trimmed = normalized.trim();
const paragraphs = trimmed
? trimmed.split(/\n\s*\n/).filter((b) => b.trim()).length
: 0;
const readingMin = trimmed
? Math.max(1, Math.ceil(cjk / 400 + latin / 200))
: 0;
return {
characters: chars,
charactersNoSpaces: noSpace,
whitespaceChars: chars - noSpace,
words: cjk + latin,
cjkChars: cjk,
latinWords: latin,
lines,
nonEmptyLines,
paragraphs,
readingTimeMinutes: readingMin,
utf8Bytes: new TextEncoder().encode(normalized).length,
};
}
Python
import math
import re
CJK_RE = re.compile(
r'[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff'
r'\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]'
)
LATIN_RE = re.compile(r"[A-Za-z0-9][A-Za-z0-9'’-]*")
def analyze_text_stats(text: str) -> dict:
normalized = text.replace('\r\n', '\n').replace('\r', '\n')
cjk = len(CJK_RE.findall(normalized))
latin = len(LATIN_RE.findall(normalized))
chars = len(normalized) # Python str is code points
no_space = sum(1 for ch in normalized if not ch.isspace())
lines = normalized.count('\n') + (1 if normalized else 0)
non_empty = (
sum(1 for line in normalized.split('\n') if line.strip())
if normalized else 0
)
trimmed = normalized.strip()
paragraphs = (
len([b for b in re.split(r'\n\s*\n', trimmed) if b.strip()])
if trimmed else 0
)
reading = max(1, math.ceil(cjk / 400 + latin / 200)) if trimmed else 0
return {
'characters': chars,
'characters_no_spaces': no_space,
'whitespace_chars': chars - no_space,
'words': cjk + latin,
'cjk_chars': cjk,
'latin_words': latin,
'lines': lines if normalized else 0,
'non_empty_lines': non_empty,
'paragraphs': paragraphs,
'reading_time_minutes': reading,
'utf8_bytes': len(normalized.encode('utf-8')),
}
Length Bands by Context
| Context | Typical band | Notes |
|---|---|---|
| Blog posts | 1500-2500 words | Common depth band; coverage beats padding |
| Product descriptions | 150-300 | Concise, highlight value |
| Technical docs | As concise as needed | Enough for the reader to finish the task |
| Tweet/X post | ≤280 characters | Platform limit |
| Commit message | ≤72 characters | Git community convention |
| PR description | 50-200 words | Clearly explain changes |
Why every tool gives you a different count
"Words" is not a defined unit. English splits on whitespace (5 words in "to be or not to be"), but hyphenated compounds ("state-of-the-art") count as one, three, or four depending on the counter; contractions ("don't") vary similarly; CJK text has no spaces, so "word count" becomes character count, or dictionary-segmented count, or both reported separately. Academic standards pin their own definitions — journal submissions usually mean whitespace-delimited tokens for Latin scripts; publishers' contracts specify counting method for a reason. When a count matters contractually, define the method, not just the number. This site puts the method on the UI: CJK characters and Latin words are listed separately.
CJK specifics: characters, not words
For Chinese, Japanese, and Korean, the meaningful units are characters (漢字/かな/한글) — Japanese mixes scripts so a useful counter must count kanji, kana, and Latin runs separately. This tool folds kana and Hangul syllables into CJK characters, then lists Latin words beside them. Translation quotes price per source character for CJK; the reverse direction (English to CJK) prices per source word. A counter that reports a single "word" number for mixed CJK-Latin text is hiding the method — look for the breakdown. Line-count for fixed forms (haiku, classical Chinese poetry) is its own discipline no word counter replaces.
The editing workflow: counts as targets, not verdicts
Word counts earn their keep as iteration targets: draft to 2x budget, cut to 1.2x, polish to budget. The professional habit is counting sections separately (intro/analysis/close) against their share of budget — a 500-word intro in a 1200-word piece is a structural flag no total reveals. Compare lines vs non-empty lines: a PDF paste where almost every line is non-empty usually means hard breaks at every line end. For SEO, the length bands matter less than coverage; chasing a word count with filler reads exactly like filler. Use the counter to find what is missing (a 200-word section where competitors run 800) rather than to pad what exists.
FAQ
How Are English Words Counted?
Latin and digit runs split on spaces; hyphens and apostrophes may stay inside the token. "Hello World" = 2 words; "Hello,World" (comma breaks the run) = 2 words; don't = 1 word.
Does Chinese Have "Word Count"?
Chinese lacks natural word boundaries. Word counters here treat each Han character (plus kana and Hangul syllables) as one word and list Latin words separately so mixed text is not collapsed into one opaque total.
Why Do Different Tools Give Different Results?
Different counting rules produce variations: whether to count spaces, code points vs UTF-16 units, and Chinese tokenization strategies. Decide whether you need characters, words, or bytes, then match that definition to the breakdown on this tool.
Triage notes
'Why every tool gives you a different count' is placed after the implementation code because the answer lives at the definition layer: a word is not a well-defined unit — hyphenated compounds get counted as 1, 3, or 4 depending on the tool — so whenever a count carries contractual weight, define the method first instead of handing over a bare number. The CJK-specifics section is equally blunt: the meaningful unit for Chinese, Japanese, and Korean is the character, and a tool reporting a single 'word count' for mixed text is hiding its method — look for the itemized breakdown, which is why this tool lists CJK characters separately from Latin words and counts an emoji as 1 by code point rather than 2 by UTF-16. The editing workflow positions counting as targets rather than verdicts: compare sections against their budget shares — a 500-word introduction inside a 1,200-word article is a structural signal the total will never show.
Written and maintained by ToolVault. The homepage collects more browser-local tools.
Related Tools
Related Articles
Markdown to Word: Native Style Mapping and the Inline-Format Downgrade List
Turning a Markdown draft into a deliverable .docx: pandoc CLI vs in-browser local conversion, how headings/tables/code blocks map to native Word styles, which inline formats degrade to plain text, and why 'editable' beats 'looks right'.
Word to Markdown: Two Clean Paths and What Survives the Conversion
How to convert .docx to Markdown cleanly: pandoc CLI vs in-browser local conversion, a format fidelity table for headings/tables/images/auto-numbering, and fixes for the .doc legacy format, image bloat, and merged-cell tables.
China License Plate Rules and Validation: Standard, New Energy, and Special Formats Explained
Mainland China plate encoding rules in full: the standard blue plate, the GA36D-2018 new-energy format, armed police and embassy plates, province abbreviations and issuing-authority letters — with an online validator.