Logo

MonoCalc

/

Text Byte Size Calculator

Text
Everything is measured locally in your browser — the text is never uploaded.

Samples:

Drop a text file here or click to browse

.txt, .md, .csv, .json, .log — up to 5 MB

Variable width, 1–4 bytes per code point

Enter or paste some text above to see its exact byte size.

About This Tool

Text Byte Size Calculator – Measure Encoded Storage Size

Characters are not bytes. The Text Byte Size Calculator takes any pasted or typed text and reports exactly how many bytes it occupies once encoded, so you can size database columns, API payloads, HTTP headers, cookies and SMS messages with a real number instead of a guess. It also shows the character, code point and grapheme counts side by side, which is where almost every “value too long” error actually comes from.

Why byte size and character count disagree

UTF-8 is a variable-width encoding. A code point costs between one and four bytes depending on where it sits in the Unicode range, which means an English sentence and a Japanese sentence of the same visible length can differ in size by a factor of three.

Code point rangeUTF-8 bytesTypical content
U+0000–U+007F1ASCII letters, digits, punctuation
U+0080–U+07FF2Accented Latin, Greek, Cyrillic, Hebrew, Arabic
U+0800–U+FFFF3CJK ideographs, most symbols, currency marks
U+10000–U+10FFFF4Emoji, historic scripts, rare CJK extensions

So Hello, 世界! 👋 is 13 UTF-16 code units, 12 code points, 12 graphemes — and 21 bytes. The eleven ASCII characters cost one byte each, the two ideographs cost three each, and the waving hand costs four on its own.

Code units, code points and graphemes

These three counts only agree for plain ASCII. Code units are what String.length returns in JavaScript, Java and C#, where anything outside the Basic Multilingual Plane occupies two. Code points are true Unicode scalar values. Graphemes are what a reader perceives as a single character. That is why "👨‍👩‍👧".length is 8: three emoji joined by two zero-width joiners, each emoji being a surrogate pair.

Choosing the right encoding

The tool measures nine encodings at once. UTF-8 is the cheapest for Latin-heavy text and the web default. UTF-16 uses a flat two bytes for BMP characters, which makes it smaller than UTF-8 for dense CJK content. UTF-32 spends four bytes on everything in exchange for constant-time indexing. ASCII, Latin-1 and Windows-1252 are single byte but cannot represent most of Unicode — the comparison view greys them out and names the offending characters. GSM-7 packs seven bits per character for SMS traffic.

Byte limits in the real world

Many limits people treat as character limits are byte limits. An HTTP cookie is capped near 4096 bytes, most servers reject headers beyond 8192 bytes, an SQS message tops out at 256 KB and a DynamoDB item at 400 KB. A MySQL VARCHAR(255) column using utf8mb4 reserves up to 1020 bytes. Set a byte limit or pick a preset and the progress bar shows how much room is left, with a safe-trim helper that cuts on grapheme boundaries so no emoji is sliced in half.

Binary versus decimal units

A KiB is 1,024 bytes and a KB is 1,000 bytes. Operating systems generally report binary units while drive vendors and network engineers quote decimal ones, so a 5% discrepancy at the kilobyte scale grows to roughly 10% at the megabyte scale. Match the toggle to whichever system you are being measured against.

SMS segmentation and compression

SMS uses GSM-7 when every character fits its alphabet, giving 160 characters in a single segment and 153 in each part of a concatenated message. One emoji or curly quote forces the entire message to UCS-2, which allows only 70 and 67 respectively — the tool names the exact character responsible. The gzip panel compresses the text with the browser's native compression stream where available so you can judge real transfer cost rather than raw payload size.

Everything stays on your device

Encoding, comparison, hex dump and export all run locally in your browser. No text is uploaded, which makes the tool safe for credentials, customer records and unreleased copy.

Reading the hex dump

The dump lists an offset, the encoded bytes and their printable ASCII rendering. It is the quickest way to see a BOM (EF BB BF in UTF-8) or to watch a single emoji occupy the four bytes F0 9F 91 8B while an ASCII letter occupies one. When debugging mojibake, comparing the dump against what a system stored tells you immediately whether the data or the declared encoding is wrong.

Frequently Asked Questions

Is the Text Byte Size Calculator free?

Yes, Text Byte Size Calculator is totally free :)

Can I use the Text Byte Size Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Text Byte Size Calculator?

Yes, any data related to Text Byte Size Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does the Text Byte Size Calculator work?

Your text is walked one code point at a time and each code point is priced according to the rules of the encoding you picked — 1 to 4 bytes in UTF-8, a flat 2 or 4 in UTF-16, a flat 4 in UTF-32, 1 in the 8-bit encodings, and 7 bits in GSM-7. The totals are added up in your browser, so nothing is uploaded and the number updates as you type.

Why is the byte size larger than the character count?

Because UTF-8 is variable width. Plain ASCII letters cost 1 byte, accented Latin letters and Greek or Cyrillic cost 2, most CJK ideographs cost 3, and emoji cost 4. A 10-character sentence with two emoji is 8 + 8 = 16 bytes, not 10, which is exactly why byte-limited fields overflow sooner than people expect.

What is the difference between characters, code points, and graphemes?

Characters here means UTF-16 code units — what JavaScript's .length returns. Code points are true Unicode scalar values, so an emoji outside the BMP counts as 1 rather than 2. Graphemes are what a reader perceives as one character, so a family emoji built from several code points joined by zero-width joiners counts as 1. The three numbers only agree for plain ASCII.

Why does KB sometimes mean 1000 bytes and sometimes 1024?

Both conventions are in use. The binary units KiB, MiB and GiB are powers of 1024 and are what operating systems usually report, while the decimal units KB, MB and GB are powers of 1000 and are what drive manufacturers and network engineers use. Switch the unit system toggle to match whichever standard your target system applies.

Why does one emoji turn my SMS into two messages?

SMS uses the 7-bit GSM-7 alphabet when every character fits in it, giving 160 characters per segment. A single character outside that alphabet — an emoji, a curly quote, a CJK character — forces the whole message into UCS-2, which allows only 70 characters per segment. The tool names the exact character responsible so you can replace it.

How accurate is the gzip estimate?

When your browser supports CompressionStream the text is genuinely gzipped and the figure shown is exact for that input. Otherwise an entropy-based approximation is shown and labelled as an estimate. Real-world transfer size also depends on server compression level and HTTP framing, so treat it as a close guide rather than a contract.