Text Tools

Inspect a string: length, characters, bytes and more

String Inspector measures any text you paste with seven figures: Length, Characters, Code points, Bytes (UTF-8), Words, Lines and Unique characters. Backend developers use it to check text against column limits, where a UTF-8 column counts bytes and a JavaScript string counts UTF-16 units, and frontend teams size up strings before an API call. The figures differ for text with accents or emoji, which is the point: café is 4 characters but 5 bytes, and one emoji can be 2 units, 1 code point and 4 bytes.

How to use String Inspector

  1. Open String Inspector in the Toolbox101 app.
  2. Paste or type any text, such as a message, a log line or a code snippet, into the Text box.
  3. Read the seven figures in the Output box: Length, Characters, Code points, Bytes (UTF-8), Words, Lines and Unique characters.
  4. Edit the text to watch each figure shift, then click Copy to take the full report.

Worked example

String Inspector returns the output below for this input.

Input

first line
café

Output

Length: 15
Characters: 15
Code points: 15
Bytes (UTF-8): 16
Words: 3
Lines: 2
Unique characters: 13

Check it yourself: open String Inspector and enter the same input.

Frequently asked questions

Why is the byte count higher than the character count?

Bytes (UTF-8) is the encoded size, and accented letters, non-Latin scripts and emoji take more than one byte: é is two bytes, an emoji four, while ASCII letters take one. So café reports 4 characters and 5 bytes.

What is the difference between Length, Characters and Code points?

Length is what JavaScript's .length returns, counted in UTF-16 units, so an emoji can count as 2. Code points counts Unicode code points, where that emoji is 1. Characters counts what a reader sees as one character, so an emoji with a skin tone or a letter with a combining accent is 1 even though it is several code points.

How are words and lines counted?

Words are whitespace-separated runs after the ends are trimmed, so don't and 3.5 each count as one word and punctuation is not split out. Lines are the segments split at line breaks, and a single trailing newline does not add an extra line.

What exactly counts as a unique character?

Each distinct character, counted once: hello has 4 because l appears twice. Matching is case-sensitive, so H and h differ, and spaces and line breaks count as characters.

What is the difference from the Word Counter tool?

Word Counter gives the headline numbers, words, characters and lines, plus a reading time. String Inspector adds the UTF-16 length, code points, the exact UTF-8 byte size and unique characters, which matter for column sizing and payload checks.

Use String Inspector now

Runs in your browser. Nothing you type is uploaded.