%3C/text%3E%3C/svg%3E">
πŸ’»
πŸ’» Tech & IT

String Length & Byte Size Calculator

Results update as you type.

Your numbers

Understanding the string length and byte size calculator β€” concept and principle

The "length" of a text depends on what you count: characters, UTF-8 bytes, UTF-16 bytes, words or lines. A database column, a message field or an API limit usually measures only one of them, and the numbers differ sharply for Korean, Chinese or emoji. This calculator gives all five at once so you can check a value against the limit that actually applies.

Characters versus UTF-8 and UTF-16 bytesμ•ˆλ…•ν•˜μ„Έμš” Hello has 11 characters: 21 UTF-8 bytes, 22 UTF-16 bytes, 2 words and 1 line.11 characters, but how many bytes?μ•ˆλ…•ν•˜μ„Έμš”HelloUTF-8: 5 Γ— 3 + 1 + 5 Γ— 1 = 21 bytesUTF-16: 11 Γ— 2 = 22 bytes11characters2words1lines1 block = 1 byte Β· Hangul costs 3 in UTF-8
Each Hangul syllable takes three UTF-8 bytes, so the same 11 characters weigh 21 bytes.

How it is calculated

The principle

Text is stored as numbers, and different encodings spend different amounts of space per number. UTF-8 was designed so that plain English stays one byte per letter, while scripts outside ASCII cost more. UTF-16 spends at least two bytes on everything, which makes it more compact than UTF-8 for East Asian text written mostly in 3-byte characters, but larger for ASCII. The word count only looks for spaces, so it reflects word-separated languages well.

Worked example

  1. Input: μ•ˆλ…•ν•˜μ„Έμš” Hello.
  2. Characters: 5 Hangul syllables + 1 space + 5 Latin letters = 11.
  3. UTF-8: 5 Γ— 3 + 1 + 5 Γ— 1 = 15 + 1 + 5 = 21 bytes.
  4. UTF-16: all 11 characters are in the BMP, so 11 units Γ— 2 = 22 bytes.
  5. Words: one space separates two groups, so 2 words; there is no line break, so 1 line.

How to read the result

Compare each count with how the target system measures length. Many SQL databases define VARCHAR in characters, but some (or some settings) count bytes, and indexes often have byte limits. JavaScript's .length and Java's String.length() return UTF-16 units, while Python's len() returns code points. Plain GSM SMS allows 160 characters of its 7-bit alphabet; any character outside it switches the message to UCS-2, where the limit is 70.

Common mistakes

Keep in mind: Code points are not always the characters a person sees. Emoji sequences, flags and combining marks can make one visible symbol count as several characters and many bytes, so leave headroom when a limit is strict.

Frequently asked questions

How many bytes is one Korean character?

3 bytes in UTF-8 and 2 bytes in UTF-16 for any precomposed Hangul syllable.

Why is UTF-16 bytes not always characters Γ— 2?

Characters above U+FFFF, such as πŸ˜€, use two 16-bit units, so they take 4 bytes.

Is a BOM counted?

No, only the text itself is encoded.

Sources: The Unicode Consortium, The Unicode Standard, Chapter 3 (Unicode encoding forms) Β· IETF RFC 3629, UTF-8, a transformation format of ISO 10646 Β· 3GPP TS 23.038, Alphabets and language-specific information (GSM 7-bit alphabet)

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser β€” nothing you type is sent anywhere.

πŸ’» All tech & IT tools β†’πŸŒ Calculators by country β†’