About String Length, Byte Size & Character Count
A string's length is rarely a single number. JavaScript's `String.length` counts UTF-16 code units, a database column counts characters or bytes, and an emoji like 👨👩👧 is one thing on screen but five code points and many bytes under the hood. This string inspector reports all of those measurements at once so you can see exactly what every layer of your stack will count.
Paste any text and get its character (code-unit) length, Unicode code-point count, grapheme count (emoji and ZWJ sequences counted as one), UTF-8 byte size, line and word counts, plus case totals, character categories, and quick checks like is-ASCII, is-URL-safe, and is-numeric.
Everything runs in your browser using built-in `Intl.Segmenter` and `TextEncoder` APIs — nothing you paste is ever uploaded, so it works completely offline.
Features
- Code units, code points, graphemes, and UTF-8 bytes side by side
- Emoji and ZWJ sequences counted as a single grapheme
- Case totals, character categories, and first/last char details
- Quick checks: is-ASCII, is-URL-safe, is-numeric, contains-emoji
How to use
- Type or paste a string into the input pane.
- Read the grouped breakdown on the right — length, case, categories, and quick checks.
- Copy any value with the inline copy button, or clear the input to start over.
Frequently asked questions
Why is the character count different from the grapheme count?
Characters here means UTF-16 code units (what String.length returns). A single emoji like 🚀 is one grapheme but two code units, and a ZWJ family emoji is one grapheme made of several code points. The grapheme count matches what a person perceives as one character.
What is the difference between code points and bytes?
A code point is one Unicode scalar value. UTF-8 bytes are how that text is actually stored or transmitted — ASCII characters take one byte, accented Latin letters two, and most emoji four. Databases and APIs often limit fields by bytes, not characters.
Which length should I use for a database column or API limit?
It depends on the system. Many SQL VARCHAR limits and Twitter-style counts are by characters or code points, while UTF-8 byte limits (common in indexes and some APIs) use the UTF-8 byte count. This tool shows all of them so you can match the right one.
Is my input sent anywhere?
No. All inspection happens locally in your browser using the built-in Intl.Segmenter and TextEncoder APIs. Your text never leaves your device, and the tool works offline.
Related tools
Everything runs locally in your browser — your input is never uploaded.