Skip to content
browserutils

String Length Calculator

Calculate string length in chars, bytes, and encodings

String Length Calculator is a free online tool from BrowserUtils that calculate string length in chars, bytes, and encodings. It runs entirely in your browser — your data never leaves your device. No account required.

0
Characters
0
JS Code Units
0
UTF-8 Bytes
0
UTF-16 Bytes
0
Words
0
Lines

How to use String Length Calculator

  1. 1 Paste or type your input into the editor above.
  2. 2 The tool processes your data instantly — right in your browser, with nothing sent to a server.
  3. 3 Copy the result with one click or continue editing your input.

About String Length Calculator

Free online string length calculator. Get the length of any string in characters, bytes, UTF-8, and UTF-16 encoding units. This tool runs entirely in your browser — your data is never sent to a server. Just paste your input, get instant results, and copy with one click. No sign-up or installation required.

String Length Calculator specs

Runtime
100% client-side (browser)
Built on
Native JavaScript String, Intl.Segmenter, and RegExp APIs with full Unicode support
Cost
Free — no account, no rate limits, no usage caps
Browser support
Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
Part of
299 developer tools on BrowserUtils (100% client-side)

Questions

Why are character count and byte count different?
Characters and bytes differ because multi-byte encodings like UTF-8 use more than one byte for non-ASCII characters. For example, an emoji might be 1 character but 4 bytes in UTF-8.
What encodings does the string length calculator support?
The tool shows lengths in JavaScript characters (UTF-16 code units), Unicode code points, UTF-8 bytes, and UTF-16 bytes so you can plan for different storage and transmission contexts.
How do I check if my string fits a database column size?
Check the byte count for your database encoding (usually UTF-8). A VARCHAR(255) column in MySQL with UTF-8 encoding allows 255 bytes, which may be fewer than 255 characters if non-ASCII text is present.
Does the string length calculator count emoji correctly?
Yes, the tool shows both the JavaScript .length value (which counts UTF-16 code units) and the true Unicode code point count. Some emoji are 2 code units in JavaScript but 1 visible character.
Embed this tool

Copy this code to embed the tool on your website. Adjust the height to fit your layout.

<iframe src="https://www.browserutils.dev/embed/string-length-calculator" width="100%" height="500" frameborder="0" title="String Length Calculator"></iframe>

Related tools

More Text & String Utilities

View all Text & String Utilities tools