Text Encoding Calculator

Paste any text to see its size in UTF-8, UTF-16 and UTF-32, its Base64, URL-encoded and hex forms, and how many characters fall outside ASCII.

Built by Sabki SolutionsRules: Unicode UTF-8 / UTF-16 / Base64Last updated

UTF-8 Size

29 bytes

Characters (code points)

17 (6 non-ASCII)

UTF-16 Size

34 bytes (17 units)

UTF-32 Size

68 bytes

Base64 Length

40 characters

URL-encoded Length

67 characters

Base64:4KSo4KSu4KS44KWN4KSk4KWHIERoYW5pa2FDYWw=
URL-encoded:%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87%20DhanikaCal
UTF-8 bytes (hex):E0 A4 A8 E0 A4 AE E0 A4 B8 E0 A5 8D E0 A4 A4 E0 A5 87 20 44 68 61 6E 69 6B 61 43 61 6C

Text Size in Bytes and Encodings

Type or paste text in any language. The calculator counts characters and shows how many bytes it takes in each Unicode encoding, plus its Base64, URL-encoded and raw hex forms (long outputs are shortened).

UTF-8 bytes per character

Code point rangeBytesExamples
U+0000 to U+007F1English letters, digits, punctuation
U+0080 to U+07FF2é, ñ, Greek, Cyrillic, Arabic, Hebrew
U+0800 to U+FFFF3Devanagari, Tamil, Telugu, Chinese, ₹
U+10000 and above4Emoji, rare scripts

Formulas

  • UTF-16 bytes = 2 × code units (surrogate pairs count 2)
  • UTF-32 bytes = 4 × code points
  • Base64 length = 4 × ceil(bytes ÷ 3)

Worked examples

1. "नमस्ते DhanikaCal" (the default). 17 characters; 29 bytes UTF-8; 34 bytes UTF-16; Base64 40 characters.

2. "Hello". 5 bytes; Base64 SGVsbG8=.

3. "Hi 👋". 4 characters but 5 UTF-16 units; 7 bytes UTF-8.

Text is processed in your browser; nothing is sent to a server.

Related tools

Frequently Asked Questions

How many bytes is a character?

In UTF-8: 1 byte for ASCII (English letters, digits), 2 for Latin accents, Greek, Cyrillic and Arabic, 3 for Indian scripts, Chinese, Japanese and most symbols, and 4 for emoji.

Why is Hindi text larger in UTF-8?

Devanagari code points (U+0900 to U+097F) need 3 bytes each in UTF-8. नमस्ते is 6 code points and 18 bytes. In UTF-16 they take 2 bytes each.

What is the difference between UTF-8 and UTF-16?

UTF-8 uses 1 to 4 bytes per character and is compact for English and web content; UTF-16 uses 2 or 4 bytes and is used internally by Windows, Java and JavaScript.

Why does an emoji count as 2 characters in some programs?

Emoji lie above U+FFFF, so UTF-16 stores them as a surrogate pair of two code units. JavaScript's length counts code units, giving 2.

How much bigger is Base64?

Base64 turns every 3 bytes into 4 characters, about 33% larger, padded with = to a multiple of 4.

What is URL encoding?

Percent-encoding replaces characters not allowed in URLs with %XX for each UTF-8 byte, so a space becomes %20 and न becomes %E0%A4%A8.

What is a code point?

The number Unicode assigns to a character, written U+XXXX. "Characters" here counts code points; some visible symbols combine several.

Why do SMS limits change with Hindi text?

A single SMS holds 160 GSM-7 characters but only 70 when the text needs Unicode (UCS-2), as Hindi does.

Is Base64 encryption?

No. It is an encoding anyone can reverse; it only makes binary data safe to send as text.

Which encoding should I use?

UTF-8 for files, web pages, APIs and databases unless a system requires otherwise.

Related Calculators

More in Computer Science · Engineering calculators · All calculators A–Z