100% private • Runs in your browser • No server upload

Byte Counter

Free online byte counter. Measure text size in UTF-8 bytes, KB, and MB. Check file sizes, API payload limits, and database field sizes. 100% private.

What this Byte Counter does

This free byte counter measures the exact UTF-8 byte size of your text — the same size it would occupy when saved as a file on disk. See the byte breakdown with automatic B/KB/MB formatting, alongside character count, word count, and reading time. Essential for developers checking API payload sizes, database field limits, and encoding behavior. Everything runs locally in your browser.

  1. 1.Type or paste your text into the editor, or drag and drop a text file.
  2. 2.See the exact UTF-8 byte count update in real time — displayed in bytes with automatic KB/MB formatting for larger texts.
  3. 3.Compare the byte count against your character count to understand the encoding overhead of your text.

Frequently asked questions

Is my text uploaded to a server?

No. Byte counting uses the browser's built-in TextEncoder API — all calculations happen locally. Your text never leaves your device.

How is the UTF-8 byte count calculated?

The tool uses TextEncoder.encode() to convert your text to a UTF-8 byte array, then measures its length. This is the same encoding used when saving text files on modern systems, so the count matches real file sizes.

Why do some characters take more bytes than others?

UTF-8 is a variable-width encoding: ASCII characters (A-Z, 0-9) use 1 byte, Latin accented characters (é, ñ) use 2 bytes, CJK characters (中, 日, 한) and most emoji use 3 bytes, and some complex emoji use 4 bytes.

Why is the byte count different from the character count?

Character count treats every symbol as 1, regardless of encoding. Byte count reflects actual storage cost — a Chinese character is 1 character but 3 bytes. The difference shows the encoding overhead of non-ASCII text.

Does the byte count match the actual file size when I save the text?

Almost exactly. The count reflects the UTF-8 encoded size. Actual file size may differ by a few bytes due to line ending characters (\r\n vs \n) or BOM markers, but for standard text the match is precise.

How does this help with database field limits?

Many databases (MySQL, PostgreSQL) measure VARCHAR column limits in bytes, not characters. A VARCHAR(255) column holds 255 bytes, which is 255 ASCII characters but only ~85 Chinese characters. This tool shows you the real byte cost.

Can I use this to check API payload sizes?

Yes. If you're building JSON payloads for REST APIs, paste the JSON text here to see its exact byte size. This helps you stay under request body limits (commonly 1MB for most APIs).