Calculate the size of text in bytes, kilobytes, and bits across different character encodings.
| Encoding | Bytes | Bits | KB | Avg bytes/char |
|---|
Different character encodings use different numbers of bytes to represent text. This matters for database column sizing (VARCHAR limits), API payload limits, URL length limits, and network bandwidth estimation.
Non-ASCII characters (accented letters, CJK, emoji) require multiple bytes in UTF-8. The string "Hello" is 5 bytes, but "Héllo" is 6 bytes (é = 2 bytes). An emoji like "🚀" is 4 bytes.
Use UTF-8 (specifically utf8mb4 in MySQL) for any text that might contain non-English characters or emoji. VARCHAR(255) in utf8mb4 can store 255 characters but up to 1020 bytes. Check your database's limits.