String Length Calculator
Calculate byte size and character length of any string.
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.
Related tools
Word Counter
Count words, characters, sentences, and paragraphs in real-time.
Character Counter
Count characters with and without spaces instantly.
Case Converter
Convert text to UPPER, lower, Title, camelCase, snake_case, or kebab-case.
Lorem Ipsum Generator
Generate placeholder text in any number of paragraphs or words.