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

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

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

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.

Features

  • Compares UTF-8, UTF-16 and UTF-32 sizes
  • Shows exact bytes, line-ending and BOM effects
  • Checks an optional byte budget
  • Shows encoded output that you can copy explicitly
  • Inspects how individual characters contribute to size

Use cases

  • Check an API payload before sending it
  • Compare encodings for a local text file
  • Choose line endings and a BOM for an export
  • Compare Base64 and URL-encoded text sizes

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.

JSON to YAML

Convert JSON to YAML locally while preserving number text and quoted strings; copy or download the complete result.

Open tool — JSON to YAML

YAML to JSON

Convert one YAML document locally to JSON with exact number text and bounded aliases, then copy or download the complete result.

Open tool — YAML to JSON

HTML to Markdown

Convert pasted or local HTML into Markdown, review conversion notes, and copy or download the result.

Open tool — HTML to Markdown

JavaScript Regex Tester

Test a JavaScript pattern locally and inspect matches, captures, and UTF-16 positions.

Open tool — JavaScript Regex Tester

Markdown to HTML

Convert a Markdown draft to an HTML fragment, inspect the source and inert preview, then copy or download it.

Open tool — Markdown to HTML

Text Sorter

Sort lines alphabetically by a chosen language or by Unicode code point, keeping duplicates, blank rows and complete line contents.

Open tool — Text Sorter

Remove Duplicate Lines

Keep the first copy of each exact text line, preserving order, significant spaces and blank rows, then copy or download the result.

Open tool — Remove Duplicate Lines

Text Diff Checker

Compare two drafts locally, with exact whole-line changes, visible whitespace rules and clear final-newline handling.

Open tool — Text Diff Checker

Case Converter

Convert text to uppercase, lowercase, capitalized words or sentence case with explicit letter rules.

Open tool — Case Converter

HTML Entity Encoder/Decoder

Encode or decode literal HTML references with explicit context, Unicode options and LF output, without parsing or rendering markup.

Open tool — HTML Entity Encoder/Decoder

Markdown Table Generator

Edit a small literal-text table, set alignment and copy GFM Markdown or import tab-separated text.

Open tool — Markdown Table Generator

Query String Parser & Builder

Edit ordered URL parameters, retain repeated names and copy a normalized query or HTTP(S) URL.

Open tool — Query String Parser & Builder

URL Encoder & Decoder

Convert a UTF-8 URL component or form value with explicit space and plus rules, then copy or download the result.

Open tool — URL Encoder & Decoder

Base64 Encoder & Decoder

Encode UTF-8 text as standard or URL-safe Base64, or decode either format with clear errors and complete text output.

Open tool — Base64 Encoder & Decoder

XML Formatter

Check namespace-aware XML 1.0, format or compact locally, and copy or download UTF-8 output.

Open tool — XML Formatter

JSON Formatter & Validator

Check JSON syntax, format or minify locally, and copy or download output while preserving original data tokens.

Open tool — JSON Formatter & Validator

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 tool — SMS Character Counter & Segment Calculator

Social Media Character Counter

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

Open tool — Social 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 tool — Character Counter

PDF Text Cleaner

Fix line breaks and spacing in text copied from a PDF. Preserve your original and review ambiguous hyphens before copying the cleaned text.

Open tool — PDF Text Cleaner

Fancy Text Converter

Convert supported fancy Unicode letters to normal text locally. Keep case, accents, emoji and your original text.

Open tool — Fancy Text Converter

Garbled Text Fixer

Fix garbled text and repair broken accents with a browser-based mojibake fixer. Review each possible UTF-8 reversal before applying it.

Open tool — Garbled Text Fixer

Gmail Clipping Checker

Measure email HTML bytes in UTF-8, compare them with an advisory 102,000-byte Gmail reference, and inspect size contributors locally.

Open tool — Gmail Clipping Checker
View all tools in this category