UTF-8 byte counter
String βlengthβ depends on what you count. UTF-8 bytes matter for storage, payloads and many API limits; UTF-16 units are what JavaScript .length and Java String.length() return; code points are what Python len() returns.
This page counts
0
0Characters
0No spaces
0Words
0Lines
0Paragraphs
0UTF-8 bytes
Technical details β what was counted
| Graphemes β visible characters | 0 |
| Unicode code points β Python len() | 0 |
| UTF-16 code units β JavaScript .length | 0 |
| UTF-8 bytes β web, DB, payloads | 0 |
| Korean SMS (EUC-KR-style) bytes, approx. | 0 |
| Whitespace (spaces, line breaks, tabs) | 0 |
| Hangul syllables | 0 |
| Reading time (230 wpm) | 0 |
| Reading time, Korean (500 syllables/min) | 0 |
Bytes per character
| Character | UTF-8 | UTF-16 units | Code points |
|---|---|---|---|
| A | 1 | 1 | 1 |
| Γ© (precomposed) | 2 | 1 | 1 |
| ν, ζΌ’, β¬ | 3 | 1 | 1 |
| π | 4 | 2 | 1 |
| π¨βπ©βπ§ | 18 | 8 | 5 |
Language equivalents
| Count | Code |
|---|---|
| UTF-8 bytes | new TextEncoder().encode(s).length Β· Python len(s.encode()) |
| UTF-16 units | JS s.length |
| Code points | JS [...s].length Β· Python len(s) |
| Graphemes | JS Intl.Segmenter |
MySQL VARCHAR(n) in utf8mb4 limits characters (code points), but index limits are in bytes; emoji need utf8mb4.
FAQ
How many bytes is an emoji?
Usually 4 in UTF-8; ZWJ sequences like π¨βπ©βπ§ can be 18 or more.
Why does JavaScript say 'π'.length is 2?
It counts UTF-16 code units; characters outside the BMP use a surrogate pair.
Are line breaks counted?
Yes: \n is 1 byte; \r\n is 2.
More counters
Character counterCharacter limits by platformTwitter (X) character counterInstagram caption character counterYouTube title character counterLinkedIn post character counterSMS character & segment counterMeta description length checkerTitle tag length checkerWord counterLine counterReading time calculatorHow many characters is an emoji?