No cookies ยท No tracking ยท Runs entirely in your browser

Byte Size Calculator

Convert storage units and calculate file transfer time

โ† devnestio
Enter Size
Quick:
Conversions
Transfer Time Calculator
Presets:

What is Byte Size Calculator?

Byte Size Calculator computes the byte size of any string, URL, or code snippet using different encodings: ASCII, UTF-8, UTF-16, UTF-32, and Latin-1. Paste or type text and instantly see how many bytes it occupies in each encoding โ€” useful for database column sizing, network packet planning, HTTP header limits, and API payload budgeting.

String length โ‰  byte size. In ASCII or Latin-1, every character is exactly 1 byte. In UTF-8, ASCII characters (U+0000โ€“U+007F) are 1 byte, Latin extended (U+0080โ€“U+07FF) are 2 bytes, most CJK and other Unicode characters (U+0800โ€“U+FFFF) are 3 bytes, and supplementary characters including most emoji (U+10000+) are 4 bytes. In UTF-16, Basic Multilingual Plane characters are 2 bytes, supplementary characters are 4 bytes. A single emoji can be 4 bytes in UTF-8, 4 bytes in UTF-16, or 8 bytes in UTF-32.

Common byte limits in practice: HTTP header maximum is 8 KB per header (configurable in nginx/Apache). MySQL VARCHAR column is up to 65,535 bytes per row. PostgreSQL field limit is 1 GB. Redis key size limit is 512 MB. Most SMS is 160 7-bit characters (140 bytes). Cookie size limit is 4,096 bytes. URL maximum length: 2,048-8,000 bytes depending on browser and server.

How to Use

  1. Type or paste your text into the input field.
  2. The byte counts for each encoding (UTF-8, UTF-16, UTF-32, ASCII, Latin-1) appear immediately.
  3. Hover over a character to see its Unicode code point, UTF-8 encoding, and byte count.
  4. Toggle 'Show per-character breakdown' to see how many bytes each character uses.
  5. Use the 'URL encode' switch to see the byte size of the URL-encoded version.

Examples

Byte size of emoji

Result: 'Hello ๐Ÿ‘‹' โ€” 5 ASCII chars (5 bytes) + 1 emoji (4 bytes UTF-8) = 9 bytes UTF-8

Japanese text

Result: 'ใ“ใ‚“ใซใกใฏ' โ€” 5 characters ร— 3 bytes each = 15 bytes UTF-8 (not 5 bytes)

MySQL VARCHAR limit check

Result: 'user@example.com' = 17 bytes ASCII โ†’ fits in VARCHAR(255) safely

Frequently Asked Questions

Why does a VARCHAR(255) column hold fewer than 255 characters for non-ASCII text?

MySQL's VARCHAR column length is in bytes (except for utf8mb4 where it's in characters, but still limited by the row size limit). A VARCHAR(255) in utf8mb4 can hold up to 255 characters but each character may use 1-4 bytes. Since MySQL rows are limited to 65,535 bytes, multiple utf8mb4 columns compete for row space. Use VARCHAR(191) for indexed utf8mb4 columns to stay within the 767-byte index prefix limit in older MySQL versions.

What is the UTF-8 byte size of common characters?

ASCII letters/digits/punctuation (U+0000โ€“U+007F): 1 byte each. Latin extended, Arabic, Hebrew, European scripts with accents (U+0080โ€“U+07FF): 2 bytes. CJK characters, most Asian scripts, many symbols (U+0800โ€“U+FFFF): 3 bytes. Emoji, mathematical symbols, rare CJK extensions (U+10000+): 4 bytes. A typical English string is 1:1 bytes to characters. A Chinese string uses 3ร— as many bytes.

How do HTTP headers calculate byte size?

HTTP/1.1 headers are ASCII text โ€” each header line is measured in bytes as its ASCII representation. The nginx default limit is 8 KB for all request headers combined (large_client_header_buffers). Apache's default LimitRequestFieldSize is 8,190 bytes per header. JWT tokens in Authorization headers can easily exceed 4 KB, so monitor total header size for large JWTs.

How many characters fit in an SMS?

Standard SMS uses 7-bit GSM encoding: 160 characters per message. If any character outside the GSM 7-bit set is used (emoji, most CJK, smart quotes, many accented letters), the entire message switches to UCS-2 (UTF-16) encoding: 70 characters per message. Multi-part SMS uses 6-7 characters for the concatenation header, reducing capacity to 153 chars (7-bit) or 67 chars (UCS-2) per part.

What is the maximum safe URL length?

The HTTP spec has no URL length limit. Browser limits: Chrome, Firefox, Safari: ~2 MB. IE 11 (legacy): 2,083 characters. Server limits: nginx default: 8 KB. Apache default: 8,190 bytes. AWS API Gateway: 8,192 bytes. In practice, keep URLs under 2,000 characters for maximum compatibility. Long URLs in query strings should use POST with a request body instead.

Related Tools