UTF-8 Byte Counter
Count the exact UTF-8 bytes of any text — with code points, UTF-16 units, a per-character byte breakdown and a byte-limit check.
Characters and bytes part company the moment text stops being plain English. UTF-8 spends 1 byte on ASCII, 2 bytes on most accented Latin, Greek and Cyrillic letters, 3 bytes on most Chinese, Japanese and Korean characters, and 4 bytes on emoji — and some emoji are sequences of several code points joined invisibly, so one glyph on screen can cost eleven bytes or more. This counter walks the text code point by code point and applies exactly that table, which makes its total reproducible by hand: “Hello” is 5 code points and 5 bytes; add “ café” and the é costs 2 bytes, not 1; the 😀 in the sample text is a single code point (U+1F600) costing 4 UTF-8 bytes but 2 UTF-16 code units, which is why JavaScript’s string length and this page’s character count disagree about it — both are counting honestly, just counting different things.
The text you type is measured in page memory on your device only: it is never uploaded, never stored and never put into a link, and refreshing the page clears it. For word, sentence and reading-time counts without the byte detail, use the Word Counter at /words/ — this page is the byte-level companion to it.
Quick answers
How many bytes is an emoji in UTF-8?
Usually 4 bytes for a single emoji code point — 😀 (U+1F600) is 4 bytes. But many emoji are sequences: a family or profession emoji joins several code points with zero-width joiners and can cost 11 bytes or more while looking like one character. The breakdown table on this page shows the cost character by character.
ASCII costs 1 byte, most accented letters 2, most CJK characters 3 — the 1/2/3/4 split follows the code point ranges U+0000–U+007F, U+0080–U+07FF, U+0800–U+FFFF and U+10000 and above.
Why does JavaScript string length differ from the character count?
JavaScript’s .length counts UTF-16 code units, not characters. Any character above U+FFFF — most emoji — is stored as a surrogate pair and counts as 2. This page shows both figures side by side: code points (true characters) and UTF-16 code units (the JavaScript number).
For plain ASCII text all three counts — bytes, code points and code units — are identical, which is why the difference surprises people the first time emoji or CJK text is involved.
How to use
- Type or paste your text — every figure updates as you type and nothing is sent anywhere.
- Read the headline figure first: the exact UTF-8 byte length. Beside it sit the character count in Unicode code points and the UTF-16 code-unit count, so you can see exactly where the three numbers diverge.
- Use the breakdown table to find the expensive characters: each of the first 50 characters is listed with its code point and its UTF-8 cost of 1 to 4 bytes.
- If a system limits you by bytes — a database field, an SMS segment budget, a cookie ceiling — type the limit into the checker and the page tells you how many bytes you have to spare, or how many you are over.
About this tool
The practical reason to care is that limits in real systems are often in bytes while people think in characters: a VARCHAR(255) defined in bytes, an API field with a byte ceiling, a legacy form that truncates mid-character and corrupts the text. The limit checker on this page exists for that moment — paste the text, set the ceiling, and see the verdict before the system gives you its own. For the neighbouring jobs: the Word Counter at /words/ counts words, sentences and reading time without byte detail, and the Token Counter estimates language-model tokens with a documented rule — three different lengths for three different questions, deliberately kept as three pages that link to each other.
How it works
UTF-8 cost per code point: U+0000–U+007F → 1 byte; U+0080–U+07FF → 2 bytes; U+0800–U+FFFF → 3 bytes; U+10000–U+10FFFF → 4 bytes. The byte length of a text is the sum over all its code points.
Worked check: “Hello, world! Café 😀” — 20 code points. Eighteen of them are ASCII at 1 byte each, é (U+00E9) costs 2, and 😀 (U+1F600) costs 4, for a total of 24 UTF-8 bytes across 21 UTF-16 code units (the emoji counts twice there).
What this tool can’t do
Counts are of the text exactly as pasted. The page does not normalise Unicode: a composed é (one code point, 2 bytes) and a decomposed e + combining accent (two code points, 3 bytes) look identical on screen but count differently — which is the honest behaviour for byte work, and the breakdown table makes the difference visible.
Grapheme clusters (what a reader perceives as one character) are not reported as a separate figure: a flag or family emoji is several code points, and for byte limits it is the code points that cost. The code-point count is the meaningful character count here.
A byte-order mark is not added: if you save the text as a UTF-8 file with a BOM, add 3 bytes (EF BB BF) to the figure yourself.
Worked examples
Plain English: “Hello” → 5 code points, 5 UTF-16 units, 5 UTF-8 bytes. All three counts agree, as they always do for pure ASCII.
Accented word: “Café” → 4 code points but 5 UTF-8 bytes, because é (U+00E9) costs 2 bytes. The breakdown table shows the é row at 2 bytes.
Against a 255-byte field: A 200-character product name heavy with accented characters measures 286 UTF-8 bytes: set the limit to 255 and the checker reports 31 bytes over — before the database truncates it for you.
UTF-8 byte cost by code point range
| Code point range | UTF-8 bytes | Typical characters |
|---|---|---|
| U+0000 – U+007F | 1 | ASCII letters, digits, basic punctuation |
| U+0080 – U+07FF | 2 | Accented Latin, Greek, Cyrillic, Hebrew, Arabic |
| U+0800 – U+FFFF | 3 | Chinese, Japanese, Korean, Devanagari, most symbols |
| U+10000 – U+10FFFF | 4 | Most emoji, rare historic scripts |
Frequently asked questions
Why is the byte count higher than the character count?
Because UTF-8 is a variable-width encoding. Only the 128 ASCII characters cost 1 byte each; everything else costs 2, 3 or 4 bytes depending on its code point. A text of 100 characters that mixes accented letters and emoji can easily be 150–250 bytes. The breakdown table shows exactly which characters cost more than 1 byte.
What is the difference between code points and UTF-16 code units?
A code point is one Unicode character — an é, a 漢, an 😀. JavaScript (and UTF-16 storage) measures strings in code units, and any character above U+FFFF — most emoji — occupies two code units (a surrogate pair). So the same 😀 is 1 code point, 2 UTF-16 units and 4 UTF-8 bytes. All three figures are shown because different systems limit by different ones.
How do I check text against a byte limit?
Type the ceiling into the byte-limit field — for example 255 for a byte-defined database column. The page compares the exact UTF-8 length against it and reports the spare bytes or the overrun. Cutting to a character count instead would not be safe: 255 multibyte characters can be far more than 255 bytes.
Is my text uploaded or stored?
No. The counting is arithmetic on the string in this page: your text is never uploaded, never stored and never put into a link, and refreshing the page clears it. That is also why there is no history or file comparison — the tool is a measuring instrument, not a workspace.
First time embedding? Read the step-by-step guide →
More free tools
Word Counter
Count words, characters, sentences and reading time as you type.
Text Case Converter
Change text to UPPERCASE, lowercase, Title Case or Sentence case in one click.
Lorem Ipsum Generator
Generate placeholder text for designs and mockups.
Remove Duplicate Lines
Delete repeated rows and lines from pasted text, keep the first occurrence.
Sort Lines Alphabetically
Sort any list A–Z or Z–A in one click.
URL Slug Generator
Turn titles into clean URL slugs.