Count UTF-8 bytes, characters and UTF-16 units separately – the three numbers that disagree whenever emoji or non-Latin scripts appear – and compare them against common limits.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
How to use the UTF-8 Byte Counter
- Paste or type the text you want to measure.
- Optionally choose a limit to compare against, such as a social post or a database column.
- Click "Count bytes" to see bytes, characters and UTF-16 units side by side.
Frequently asked questions
Why are bytes, characters and UTF-16 units three different numbers?
Because they measure different things. Characters count what a reader sees; UTF-8 bytes count storage and bandwidth; UTF-16 units are what JavaScript’s .length property returns. For pure ASCII all three agree, which is why the difference surprises people the first time emoji appear.
Which number does a database VARCHAR limit use?
It depends on the system. PostgreSQL counts characters. MySQL depends on the column definition and charset – with utf8mb4 a VARCHAR(255) holds 255 characters but may need up to 1020 bytes, and index limits are expressed in bytes. When a limit is described as a byte limit, use the byte figure.
Why does an emoji sometimes count as more than one character?
Because many emoji are sequences: a flag is two regional indicator symbols, and a family emoji joins several characters with zero-width joiners. Each component has its own code point, so the count reflects the underlying data rather than the single glyph you see.
Does this count the same way as social platforms?
Not necessarily. Platforms apply their own rules – X, for example, weights some ranges differently and counts links as a fixed length. Use the comparison as a guide, not as a guarantee.