Skip to content

Byte Counter for Text (UTF-8, UTF-16, ASCII)

See the exact byte size of any text in UTF-8, UTF-16 and Latin-1 as you type.

0UTF-8 bytes
0UTF-16 bytes
0ASCII / Latin-1 bytes
0Characters (code points)
0Visible characters (graphemes)
0Words
0Lines
0UTF-8 size in KB
0UTF-8 size in MB
Bytes per character in UTF-8CharactersExamples
1 byte (ASCII)0A–Z, 0–9, punctuation
2 bytes0Γ©, Γ±, Greek, Cyrillic, Arabic, Hebrew
3 bytes0Khmer, Thai, Hindi, Chinese, Japanese, Korean, €
4 bytes0Emoji, rare CJK, historic scripts

This byte counter shows how much space your text really takes. Paste or type anything and it instantly reports the size in UTF-8 (the encoding of the web, JSON and most databases), UTF-16 (used by JavaScript, Java and Windows) and ASCII / Latin-1, together with the number of code points, visible characters (grapheme clusters), words and lines.

Byte length matters when a database column, an SMS gateway, an API field or a file format limits size in bytes rather than characters. Letters such as Γ© take 2 bytes in UTF-8, Khmer, Thai, Chinese and Hindi characters take 3 bytes, and emoji take 4. The breakdown table and the optional highlight show exactly which characters make your text bigger. Everything is counted in your browser.

How to use the Byte Counter tool

  1. Type or paste your text into the box.
  2. Read the UTF-8 bytes figure, and the UTF-16 and Latin-1 sizes next to it.
  3. Check the table to see how many characters take 1, 2, 3 or 4 bytes.
  4. Tick Highlight characters that take 3 or 4 bytes to find the heavy ones.
  5. Copy or clear the text when you are done.

Why use ToolOrca Byte Counter

  • UTF-8, UTF-16 and Latin-1 byte counts
  • Code points and visible characters (graphemes)
  • Correct counts for emoji and Khmer, Thai or Hindi text
  • Size in KB and MB
  • Highlights 3- and 4-byte characters
  • Runs offline in your browser

How many bytes is one character?

In UTF-8, a character takes 1 to 4 bytes: 1 byte for basic Latin letters, digits and punctuation (the ASCII range); 2 bytes for accented Latin letters, Greek, Cyrillic, Arabic and Hebrew; 3 bytes for most other scripts including Khmer, Thai, Devanagari, Chinese, Japanese and Korean, and symbols such as €; and 4 bytes for emoji and rare characters.

In UTF-16, most characters take 2 bytes and characters outside the Basic Multilingual Plane, such as emoji, take 4 bytes (a surrogate pair). That is why JavaScript's "πŸ˜€".length is 2. Latin-1 (ISO-8859-1) uses exactly 1 byte per character but can only store 256 characters, so anything else cannot be saved in it at all.

Characters, code points and graphemes

What a reader sees as one character can be several code points. A family emoji such as πŸ‘¨β€πŸ‘©β€πŸ‘§ is five code points joined by zero-width joiners, and many Khmer or Hindi syllables combine a consonant with vowel signs and subscripts. The visible characters figure uses the browser's Intl.Segmenter to count these grapheme clusters the way a person would, while code points is what most programming languages count.

Frequently asked questions

How do I check the byte length of a string?

Paste it into the box above and read the UTF-8 bytes figure. In code, JavaScript uses new TextEncoder().encode(s).length, Python uses len(s.encode("utf-8")) and PHP uses strlen($s).

Why is the byte count larger than the character count?

Any character outside basic ASCII needs more than one byte in UTF-8. A 100-character Khmer or Chinese sentence is usually around 300 bytes.

How many bytes is an emoji?

Most single emoji are 4 bytes in UTF-8 and 4 bytes in UTF-16. Emoji with skin tones or joined sequences are longer: πŸ‘πŸ½ is 8 bytes and πŸ‘¨β€πŸ‘©β€πŸ‘§ is 18 bytes in UTF-8.

Does a line break count as a byte?

Yes. A Unix line break (LF) is 1 byte in UTF-8. Text copied from Windows may use CR+LF, which is 2 bytes per line break.

Is my text uploaded?

No. All counting happens in your browser and nothing is sent to a server.