Favorite places of your favorite city
Home
Add to preferred sources on Google

Text Size Calculator

Compare text encodings and payload sizes in your browser.

Your text

Processing happens locally. This tool does not upload entered text or files. The site’s shared analytics and advertising may make network requests.

Encoded text size

0 bytes

0 bytes · 0 bits

KB/MB: base 1000. KiB/MiB: base 1024. Encoded content only, not memory, compressed traffic or a full HTTP request.

UTF-8 · Do not add BOM · Preserve original

UTF-8

0 bytes

UTF-16LE

0 bytes

UTF-16BE

0 bytes

UTF-32LE

0 bytes

UTF-32BE

0 bytes

LE and BE change byte order, not size. Every comparison uses the selected BOM policy.

Effective text: 0 graphemes · 0 code points · 0 UTF-16 units. Source: 0 UTF-16 units.

Original line endings: CRLF 0 · CR 0 · LF 0

Effective line endings: CRLF 0 · CR 0 · LF 0

Payload comparison

Expansion baseline: selected raw encoding, UTF-8 · Do not add BOM · Preserve original. All rows use effective text.

JSON string · UTF-8 · 2 bytes

JSON.stringify of the entire effective text, including quotes and escapes; no wrapper or added BOM. Lone surrogates are escaped, not replaced. Pasted JSON is not parsed.

Size difference: +2 bytes

URL component · ASCII · 0 bytes

One encodeURIComponent value, not a complete URL or form. Spaces become %20. No added BOM.

Size difference: 0 bytes

Form value · ASCII · 0 bytes

One application/x-www-form-urlencoded value using URLSearchParams: no field name, equals sign or other fields. Spaces become +; lone surrogates become U+FFFD. No added BOM.

Size difference: 0 bytes

Base64 · ASCII (UTF-8 · Do not add BOM · Preserve original) · 0 bytes

RFC 4648 standard padded Base64 without wrapping. Uses selected encoding bytes, including the optional signature: 4 × ceil(bytes / 3).

Size difference: 0 bytes

Blank disables the budget. Enter a nonnegative integer, up to 9,007,199,254,740,991.

Selected raw encoding (UTF-8 · Do not add BOM · Preserve original)

Inspect a local file

Choose or drop one .txt, .json or .csv file, up to 5 MiB. It is read locally as text, never parsed or executed. UTF-32 file import is not supported.

Encoded previews and copy

Previews show at most 600 output characters. Byte totals always cover the complete text.

Character byte inspector

One-based grapheme indices in effective text. Quotes and escapes make controls visible. Contributions exclude added BOM. Intl.Segmenter groups combining and ZWJ sequences; the older-browser fallback may differ for rare scripts. Long entries are abbreviated.

How to use the calculator

  1. Paste text or inspect a local text file. The editor starts empty and keeps the original line endings.
  2. Choose an encoding, line-ending transformation and optional BOM. Read exact bytes and compare the serialized representations.
  3. Set an optional byte budget for the representation your API expects. Copy the original text, summary or complete encoded output explicitly.
  4. Read the highlighted size in automatically selected bytes, KB, MB or GB (TB/PB for larger values). Exact bytes remain below and beside other large results. Readable sizes are rounded; budget checks always use exact bytes.

Understanding bytes, encodings and payloads

A byte is eight bits; a visible character can contain multiple Unicode code points. 😀 is one grapheme, one code point and two UTF-16 units: 4 bytes in UTF-8, UTF-16 and UTF-32. Combining marks and ZWJ emoji sequences make character counts differ from byte counts.

UTF-8 uses 1–4 bytes per Unicode scalar; UTF-16 uses 2 or 4 and UTF-32 uses 4. A takes 1/2/4 bytes respectively. Cyrillic, Arabic, Chinese and emoji are valid text, even when they need more bytes. These are encoded content sizes, not JavaScript heap use or allocated disk space.

No normalization, trimming or invisible-character removal occurs. Composed é uses 2 UTF-8 bytes; e + U+0301 uses 3. Both are usually one grapheme. The original source is preserved: only the selected line-ending transformation creates effective text for results.

An added BOM costs 3 bytes in UTF-8, 2 in UTF-16 or 4 in UTF-32, even for empty text. A literal leading U+FEFF remains content. LF uses one ASCII byte; CRLF uses two. Conversion handles CRLF together, then lone CR/LF, leaving NEL, U+2028 and U+2029 unchanged.

For A space B, UTF-8 is 3 bytes, URL output A%20B is 5, and form value A+B is 3. A followed by CRLF then B is 4 UTF-8 bytes, or 3 after LF conversion; its preserved JSON string is 8 bytes. JSON includes outer quotes and escapes: it serializes the input as one string rather than minifying a JSON document.

Base64 is an encoding, not compression or encryption. Standard padded output has 4 × ceil(byteLength / 3) ASCII bytes, approaching one-third overhead for long input. UTF-8 A becomes QQ== (4 bytes). Empty input without a BOM produces empty Base64; an empty JSON string still takes 2 bytes.

File.size is the immutable original byte count, including its signature. File import supports UTF-8 and UTF-16LE/BE with strict decoding. A recognized BOM chooses the decoder and is removed exactly once; additional U+FEFF content is retained. Without a signature UTF-8 is assumed, not reliably detected. Re-encoding can differ because of encoding, line endings, BOM policy or edits.

For an API field limit, check whether the service counts raw text, a JSON string or URL/form data. This calculator excludes property names, object wrappers, field names, equals signs and HTTP headers. A zero budget accepts only an empty representation; equality fits exactly. Database and platform rules may differ. Use related tools for word counts, social limits and SMS segments.

Local processing and scope

Processing happens locally. This tool does not upload entered text or files. The site’s shared analytics and advertising may make network requests.

Frequently asked questions

A byte is eight bits; a visible character can contain multiple Unicode code points. 😀 is one grapheme, one code point and two UTF-16 units: 4 bytes in UTF-8, UTF-16 and UTF-32. Combining marks and ZWJ emoji sequences make character counts differ from byte counts.

Raw text without an added BOM uses zero bytes. JSON.stringify of empty text includes two quotes, so it uses 2 UTF-8 bytes. Adding a signature also costs bytes, even for empty text.

File.size is the immutable original byte count, including its signature. File import supports UTF-8 and UTF-16LE/BE with strict decoding. A recognized BOM chooses the decoder and is removed exactly once; additional U+FEFF content is retained. Without a signature UTF-8 is assumed, not reliably detected. Re-encoding can differ because of encoding, line endings, BOM policy or edits.

Processing happens locally. This tool does not upload entered text or files. The site’s shared analytics and advertising may make network requests.

A byte (B) contains 8 bits. Decimal units increase by 1,000: 1 KB = 1,000 bytes, 1 MB = 1,000,000 bytes and 1 GB = 1,000,000,000 bytes; TB and PB continue the same scale. Binary units increase by 1,024: 1 KiB = 1,024 bytes, 1 MiB = 1,048,576 bytes and 1 GiB = 1,073,741,824 bytes. The main result uses decimal units, with a binary equivalent and exact bytes below. For example, 3,611,805 bytes displays as 3.6 MB or about 3.4 MiB. These are different units for the same size, not compression. Uppercase B means bytes; lowercase b means bits. Rounded displays never change the exact budget comparison.

Sources

Sources reviewed: 2026-09-13. Algorithms follow these specifications; the date is not an accuracy guarantee.

SMS Character Counter & Segment Calculator

See how your message is encoded, where its segments end and what it may cost. Your text stays in your browser.

Open toolSMS Character Counter & Segment Calculator

Social Media Character Counter

Check platform-specific limits and split posts without losing text.

Open toolSocial Media Character Counter

Character Counter

Count characters, words, sentences and paragraphs. Check word density, reading time and UTF-8 size, all in your browser.

Open toolCharacter Counter