Character Counter
Character Counter expands the string with JavaScript iteration and returns the number of Unicode code points. This avoids counting a surrogate pair as two, but it is not grapheme-cluster counting: a letter plus combining accent, flags, skin-tone emoji, and zero-width-joiner sequences can contribute multiple units even when displayed as one symbol. Spaces and line breaks count.
Runs locally — files stay on your deviceDoes one visible emoji always count as one?
No. Multi-code-point emoji sequences count as several.
Code points differ from grapheme clusters
A user-perceived character can contain multiple code points joined by combining or shaping rules.
How it works
[...input].length counts string iteration units.
Key concepts
Whitespace counts
Spaces and newline code points are included.
Bytes differ
UTF-8 can use multiple bytes per code point.
When to use it
- Measure code points for a technical limit.
- Compare exact strings under one rule.
- Avoid UTF-16 surrogate-pair double counts.
When not to use it
- Do not use as visible glyph count.
- Do not infer byte length.
- Do not assume form-field limits use code points.
Worked examples
ASCII
- Input
abc- Expected output
3
One code point each.
Simple emoji
- Input
😀- Expected output
1
One supplementary code point.
Combining accent
- Input
e plus combining acute- Expected output
2
Often displays as one grapheme.
Common mistakes
Calling it glyph count
Fonts/shaping differ. Correction: Use grapheme segmentation.
Calling it byte count
Encoding is not measured. Correction: Encode then count bytes.
Ignoring normalization
Equivalent text can have different code points. Correction: Specify normalization.
Best practices
- Name the unit as code points.
- Test combining and emoji input.
- Match the destination limit's definition.
Related operations and differences
Add Prefix to Every Line
Choose Add Prefix to Every Line when you need to add the same prefix before every line.; use Character Counter specifically for count characters.
Add Suffix to Every Line
Choose Add Suffix to Every Line when you need to add the same suffix after every line.; use Character Counter specifically for count characters.
Capitalize Every Word
Choose Capitalize Every Word when you need to capitalize the first character of every word.; use Character Counter specifically for count characters.
Extract Email Addresses
Choose Extract Email Addresses when you need to find unique email addresses in text.; use Character Counter specifically for count characters.
Extract URLs
Choose Extract URLs when you need to find unique HTTP and HTTPS links in text.; use Character Counter specifically for count characters.
Find and Replace
Choose Find and Replace when you need to replace every exact occurrence in text.; use Character Counter specifically for count characters.
Limitations and privacy
- Unicode code-point count only; no grapheme, byte, UTF-16 unit, normalization, whitespace exclusion, category breakdown, or selected-range count.
The text is analyzed locally in this browser and is not uploaded by the tool.
Frequently asked questions
Are spaces counted?
Yes.
Are line breaks counted?
Yes.
Is 😀 one?
Yes when it is that single code point.
Can one visible symbol count above one?
Yes.