How to use String Length Calculator
What it does & when you need it
"How long is this string?" has more than one answer, and picking the wrong one causes real bugs. A database column capped at 255, a UTF-8 byte budget, a form that limits input, and a person counting glyphs on screen are all measuring different things. This tool reports every measure at once — Unicode code points, UTF-16 code units, UTF-8 bytes, words, lines, and user-perceived graphemes — and updates them live as you type.
It is handy when you are checking whether a value fits a column, debugging why a length check rejects an emoji, sizing a payload against a byte limit, or just confirming what an editor's character count really means. Everything is computed in your browser, so nothing you paste is uploaded.
How to use
- Type or paste text into the text buffer, press Sample for an example mixing emoji and accents, or Upload a file.
- The stat tiles update on every keystroke — no button to press. Read Characters, UTF-16 units, UTF-8 bytes, Words, Lines, and Graphemes at a glance.
- Press Copy summary (or
Ctrl/Cmd+Enter) to copy a plain-text breakdown to paste into a ticket.
Things worth knowing
Characters here means code points. JavaScript's String.length counts UTF-16
code units, so the rocket emoji is two and an astral character is two. This tool
counts by code point using Array.from, so that emoji is one — closer to what a
person means by "one character".
A code point still is not a grapheme. An emoji with a skin-tone modifier, a
flag built from two regional indicators, or a family emoji joined with
zero-width joiners is several code points that render as a single glyph. The
grapheme count uses Intl.Segmenter to report those visible units, which is
usually the number a reader would give.
Bytes depend on the encoding. The byte figure is UTF-8, computed with
TextEncoder — the encoding used by almost every file and network request. An
ASCII character is one byte, most accented Latin letters are two, most CJK
characters are three, and many emoji are four.
Need to reshape the text next? Try the word counter, case converter, or whitespace cleaner.