String Length & Bytes

Count UTF-16 length, code points, and UTF-8 byte size.

Input

 

Sponsored

How it works

How it works

  • UTF‑16 length counts 16‑bit code units (str.length).
  • Code points count uses the spread operator to handle surrogate pairs (e.g., emoji) correctly.
  • Grapheme clusters (what users perceive as characters) can span multiple code points (e.g., family emojis with ZWJ); not computed here.

Privacy & Security

All counts local.

Accuracy, Limits & Tips

No normalization; equivalent composed forms counted separately.

Examples

  • "Hello" vs emoji sequences.

Looking for broader guides and best practices? Visit the ToolsAreUs Blog for indexes (like the full tool list) and articles (e.g. secure password generation).