Skip to content
Utilities2026-07-066 min read

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

  1. 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
  2. Technical writing: Keep docs concise enough to finish the job
  3. Social media: Twitter/X 280-character limit, Weibo 140-character limit
  4. Academic papers: Strict length rules — confirm whether the venue means characters or words
  5. Code review: Control commit message and PR description length
  6. 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:

MetricEnglish "Hello World"Chinese "你好世界"
Characters (with spaces)114
Characters (no spaces)104
Whitespace chars10
Words (CJK + Latin)24 (each character = 1 word)
UTF-8 bytes1112 (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

  1. Characters: Unicode code points (one emoji = 1, not two UTF-16 units); with-spaces / without-spaces listed separately, plus an explicit whitespace count
  2. 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)
  3. Lines and paragraphs: physical lines (including blanks) vs non-empty lines; paragraphs split on blank lines
  4. 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:

  1. Paste text into the input area
  2. 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
  3. 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

ContextTypical bandNotes
Blog posts1500-2500 wordsCommon depth band; coverage beats padding
Product descriptions150-300Concise, highlight value
Technical docsAs concise as neededEnough for the reader to finish the task
Tweet/X post≤280 charactersPlatform limit
Commit message≤72 charactersGit community convention
PR description50-200 wordsClearly 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.