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.
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
4KSo4KSu4KS44KWN4KSk4KWHIERoYW5pa2FDYWw=%E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87%20DhanikaCalE0 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 6CText 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 range | Bytes | Examples |
|---|---|---|
| U+0000 to U+007F | 1 | English letters, digits, punctuation |
| U+0080 to U+07FF | 2 | é, ñ, Greek, Cyrillic, Arabic, Hebrew |
| U+0800 to U+FFFF | 3 | Devanagari, Tamil, Telugu, Chinese, ₹ |
| U+10000 and above | 4 | Emoji, 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
- Checksums: CRC Calculator. Hex and binary: Binary Calculator.
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
CRC Calculator
Calculate Cyclic Redundancy Check (CRC) values using polynomial division. Enter data and generator polynomial to compute CRC checksum.
Binary Calculator
Convert between decimal, binary, octal, and hexadecimal number systems. Perform bitwise AND, OR, XOR, NOT, and shift operations.
Color Converter Calculator
Convert colors between RGB, HEX, HSL, and CMYK formats. Enter RGB values to see all equivalent color representations.
Storage Calculator
Convert between storage units (Bytes, KB, MB, GB, TB, PB) and calculate RAID usable capacity for different configurations.
Bandwidth Calculator
Calculate network bandwidth required to transfer a file of given size in a specified time. Convert between bps, Kbps, Mbps, and Gbps.
Hamming Distance Calculator
Calculate the Hamming distance between two binary values. Determine the number of differing bit positions and error detection capability.
More in Computer Science · Engineering calculators · All calculators A–Z