Free tools for developers

String Length Counter

Count characters, bytes, words and lines in any string. Set a limit to check if your string fits. Updates as you type.

0
Length
0
Bytes (UTF-8)
0
Words
0
Lines
0
Spaces
0
No Spaces
Common limits: SMS=160, Tweet=280, Meta description=160, Title tag=60

What is String Length?

String length is the number of characters in a piece of text. In most programming languages this is what the length or len property returns. However length can mean different things depending on context - number of characters, number of bytes, or number of Unicode code points.

This tool shows you all the important measurements at once. The character length is what most programming languages report. The byte count is important when you are working with databases or APIs that have byte limits rather than character limits. Multi-byte characters like emoji or Chinese characters take more than one byte each.

Common String Length Limits

SMS messages are limited to 160 characters. Tweets are 280 characters. Meta descriptions should be under 160 characters for SEO. Page title tags should be under 60 characters. Database VARCHAR fields have a defined maximum length. Use the limit checker above to validate against any of these.


Frequently Asked Questions

Why is the byte count different from the character count?

In UTF-8 encoding, ASCII characters like letters and numbers take 1 byte each. Characters with accents take 2 bytes. Chinese, Japanese, and Korean characters take 3 bytes. Emoji take 4 bytes. So a string with emoji will have a higher byte count than character count.

Is my text safe?

Yes. Everything runs in your browser. Your text is never sent to any server.