DevToolsForYou
Private by defaultRuns in your browser

Byte size counter

Paste any text to see its exact byte size in UTF-8 encoding — useful for payloads, headers, storage limits, and API constraints.

51Bytes (UTF-8)
0.0498 KBKilobytes
0 MBMegabytes
51Characters
0Extra bytes (multi-byte chars)
UTF-8Encoding
Byte Size Counter

About this tool

Characters and bytes are not the same thing, and the gap between them is where a surprising number of production bugs live. UTF-8 encodes ASCII in a single byte, most Latin-script accented letters and Greek or Cyrillic in two, most CJK characters and Devanagari in three, and emoji in four — and many emoji are sequences of several code points joined by zero-width joiners, so a single glyph on screen can cost eleven bytes or more. That matters wherever a limit is expressed in bytes rather than characters. A MySQL VARCHAR(255) in utf8mb4 reserves bytes. DynamoDB caps an item at 400KB. SQS caps a message at 256KB. Kafka, Lambda payloads, HTTP header size limits, cookie limits, and Redis keys are all byte-denominated. A field that accepted 250 English characters in testing can reject the same field of Hindi or Japanese text in production. This tool encodes what you paste as UTF-8 and reports the exact byte count alongside the character count, plus KB and MB, so you can see the multiplier at a glance. It runs in your browser.

No signup requiredRuns in your browserInstant results
How to use
  1. 1

    Paste or type your string into the input field.

  2. 2

    The byte size in UTF-8 encoding is calculated and displayed instantly.

  3. 3

    Compare the character count vs byte count — they differ for non-ASCII characters like emoji or accented letters.

Why use this tool?
  • →

    Check payload size before sending API requests with byte-limit headers.

  • →

    Verify that a message or token fits within storage or transmission constraints.

  • →

    Understand how multi-byte Unicode characters affect the actual byte length of a string.

ExamplesInput → output

ASCII string

Inputhello
Output5 bytes (5 characters)

Unicode string

Inputनमस्ते
Output18 bytes (6 characters)

Emoji

InputHello 👋
Output10 bytes (7 characters)
Common errorsAnd how to fix them

Byte count is much higher than the character count

Cause: This is correct behaviour, not an error. Any character outside the ASCII range costs more than one byte in UTF-8, and emoji built from joined code points cost several times more than they appear to.

Fix: Size your database columns and payload limits against the byte count for the worst-case script you expect to accept, not against English test data.

My database reports a different size for the same string

Cause: The column may not be UTF-8. MySQL's legacy utf8 charset stores at most three bytes per character, latin1 stores one, and SQL Server's NVARCHAR uses UTF-16, where ASCII costs two bytes rather than one.

Fix: Check the actual column charset. On MySQL, use utf8mb4 rather than utf8 — the latter cannot store four-byte characters such as emoji at all, and will either truncate or reject them.

Counting a base64 string or a file

Cause: This tool measures the UTF-8 encoding of text. Base64 inflates binary by roughly 33 percent, so the byte count of a base64 string is not the size of the data it represents.

Fix: For an encoded payload, divide the base64 length by 1.37 for an approximate original size, or measure the file directly. Remember that transport limits apply to the encoded size, which is the larger number.

Frequently asked questionsCommon questions answered

These answers explain common byte size counter tasks, expected input formats, and edge cases so both visitors and search engines can understand what this tool does.

Why does character count differ from byte count?

In UTF-8 encoding, characters outside the basic ASCII range (such as emoji or accented letters) use multiple bytes. A single emoji can be 3 or 4 bytes, so byte count is always equal to or greater than character count.

What encoding does this tool use?

This tool measures byte size using UTF-8 encoding, which is the standard for the web and most modern APIs and databases.

Why would I need to know the byte size of a string?

Many systems enforce byte-based limits rather than character limits — including HTTP headers, message queues, database columns, and JWT token size restrictions.

What limits commonly use byte size rather than character count?

MySQL VARCHAR and TEXT columns, Redis string values, HTTP headers (typically 8 KB), cookie size limits (4 KB per cookie), and message queue payload caps all enforce byte limits. Using character count alone can cause silent truncation when your string contains multi-byte characters like emoji or CJK glyphs.

Why does an emoji count as more than one byte?

Emoji and many non-Latin characters require multiple bytes in UTF-8. A common emoji uses 4 bytes, a Chinese or Arabic character typically uses 3 bytes, and an accented Latin character uses 2 bytes. Only the basic ASCII set uses exactly 1 byte per character.