BrainCoder
Text ToolsNothing uploaded

Text Size Calculator

Measure bytes, chars & file size

Free forever — no sign-up, nothing uploaded. Files never leave your device.

braincoder.app/use/text-size-calculator

Text Size Calculator

Measure bytes, chars & file size

Drop your file here

or browse from your device

Browse files

document.pdf

1.2 MB

report.pdf

860 KB

100% private

Nothing is uploaded — everything runs in your browser.

Free forever

No account or payment required.

No sign-up

Open the tool and start using it right away.

Local processing

Processing time depends on your input and device.

About this tool

Measure any text in UTF-8 and UTF-16 bytes and characters, with or without whitespace, plus minify and beautify valid JSON. Works for all types of text.

The Text Size Calculator measures any text — plain prose, code, JSON, logs, config files, or pasted clipboard content — in UTF-8 bytes, UTF-16 bytes, characters, words and lines, updating live as you type or paste. Sizes are shown in human-readable B, KB and MB units, so you can instantly answer questions like "how big is this string in bytes?" or "does this JSON payload fit an API limit?".

Toggle "Exclude whitespace" to see the same metrics with spaces, tabs and line breaks removed — ideal for estimating minified payload size or storage budgets. When the input is valid JSON, the tool offers minify and beautify actions with copy buttons and a size reduction percentage. For non-JSON text it provides a whitespace-collapse preview and clearly notes that full minify and beautify require valid JSON. An optional file picker measures any text file's real on-disk byte count and loads its contents for full metrics.

All counting happens in your browser with the native TextEncoder API — nothing is uploaded, stored, or shared. This makes it safe for API keys, tokens, and any sensitive text.

Key features

Everything you get with Text Size Calculator — no premium upsell.

Live UTF-8 and UTF-16 byte counts with human-readable B, KB and MB units

Character, word, line and whitespace counts for all types of text

Exclude-whitespace mode for minified-size and storage estimates

Minify and beautify valid JSON with copy buttons and size reduction

Whitespace-collapse preview for non-JSON text (honestly labeled)

Open any text file to read its exact on-disk byte size

100% client-side with the native TextEncoder API — nothing leaves your browser

How to use Text Size Calculator

Follow the steps below to use the tool.

  1. 1

    Type or Paste Your Text

    Enter any text — code, logs, JSON, or copy — into the input. Byte and character metrics update live as you type.

  2. 2

    Toggle Whitespace Exclusion

    Enable "Exclude whitespace from size" to see bytes and characters counted without spaces, tabs and newlines.

  3. 3

    Measure a File

    Click "Open file" to read a text file's exact on-disk byte count and load its contents for full metrics.

  4. 4

    Minify or Beautify JSON

    For valid JSON, copy a beautified or minified version with its byte size and reduction percentage. Non-JSON text gets an honest whitespace-collapse preview instead.

Still free, still private — your files never leave your device.

Launch Text Size Calculator

Frequently asked questions

Quick answers before you launch the tool.