Character & word counter

Character & word counter

Count characters, words, lines, CJK ideographs and UTF-8 bytes

Computed in your browser

Type or paste text for live totals. Before checking a limit, confirm whether the target counts characters, bytes or uses its own weighting rules.

Characters (with whitespace)0
Characters (no whitespace)0
Words0
Lines0
CJK unified ideographs0
Bytes (UTF-8)0

Example

Input

A中
B

Example result

Code points: 4 · Non-whitespace: 3 · Lines: 2 · UTF-8 bytes: 6

The newline is one code point and one UTF-8 byte; 中 occupies three bytes.

Technical details & limits

Characters are counted by code point and bytes by UTF-8 TextEncoder, so the totals can differ. Combining marks and joined sequences may contain multiple code points. Word groups use runs of letters and numbers with connectors, not Chinese lexical segmentation. Han counting covers the ranges implemented here, not every Unicode extension.

About this tool

Count Unicode code points, non-whitespace characters, word groups, lines, Han characters and UTF-8 bytes in real time. Compare field-length and byte limits with clearly stated counting rules.

Use cases

  • Check character totals before publishing or submitting text. A target platform may count differently; verify its own rules.
  • Estimate how many UTF-8 bytes a mixed CJK/Latin block will consume in a column.
  • Quickly see how many lines a CSV has, and whether it has blank rows.

How to use

  1. Paste the text; every count updates as you type.
  2. Characters are counted both with and without whitespace.
  3. Bytes are counted as UTF-8, which is what tells you whether a field limit is exceeded.

Notes

Word groups use consecutive Unicode letters, numbers, underscores and supported connectors, not natural-language segmentation. Continuous Chinese may count as one group; use the Han column for character totals. Bytes use UTF-8.

FAQ

Why do character counts differ from UTF-8 byte counts?
Character counts measure Unicode code points, while UTF-8 byte counts measure the encoded data length. A uses 1 byte, and a common Chinese character uses 3, so 2 visible characters do not necessarily require 2 bytes. Check the unit used by the receiving system before enforcing a limit. A field constrained by byte length can reject text that still fits a limit expressed as characters.
Does the online word counter perform Chinese word segmentation?
This counter does not perform semantic Chinese word segmentation; it identifies continuous runs of letters, numbers, and supported connectors. For example, hello world contains 2 groups, while hello contains 1. A continuous Chinese passage may therefore count as a single group. Use the Chinese-character and overall character counts when assessing Chinese text length, rather than interpreting this word count as a linguistic analysis of the passage.
Does the text line counter include empty lines?
The line counter includes empty lines created by newline separators, including an empty final line. Text containing A and B with 1 newline between them has 2 lines; adding another newline after B creates a third. Count the separators rather than only the lines with visible content when checking logs or copied tables. This explains why a trailing newline can change the displayed total without adding readable text.

Related tools

Character & word counter · Count characters, words, lines, CJK ideographs and UTF-8 bytes
Character & word counter — Tool illustration · dayeku.com