String Length Calculator

Calculate byte size and character length of any string.

Ad Slot
Ad Slot

Frequently asked questions

Why do "Total Length" and "Bytes (UTF-8)" show different numbers?

"Total Length" counts UTF-16 code units — basically the JavaScript string length — while "Bytes (UTF-8)" counts the actual encoded bytes, and any character outside basic ASCII takes 2-4 bytes in UTF-8, so accented or non-Latin text shows a higher byte count.

Does "Spaces" include tabs and other whitespace?

No — it only counts literal space characters; newlines get their own separate count and tabs aren't counted at all.

What counts as a "Unique Char" for something like an emoji?

Uniqueness is measured per UTF-16 code unit rather than per visible character, so an emoji outside the Basic Multilingual Plane — stored as a surrogate pair — can contribute two entries to that count instead of one.

We use cookies for analytics and to show ads that keep this site free. No personal data is sold.