Developer Tools

JSON Size Calculator

JSON Size Calculator reports the UTF-8 byte size of your input and of compact and two-space formatted JSON produced after parsing. It does not estimate gzip compression or transfer time.

Paste JSON to compare its original UTF-8 byte count with compact and two-space formatted versions. Parsing also checks JSON syntax.

Enter your input and tap Calculate.

Browser-side developer and utility helpers for everyday and learning use. Everything runs locally in your browser and nothing you enter is uploaded. Validate production or security-critical output with trusted, official tools before relying on it.

About this tool

JSON Size Calculator reports the UTF-8 byte size of your input and of compact and two-space formatted JSON produced after parsing. It does not estimate gzip compression or transfer time.

How to use

  1. Paste a JSON object, array, or value.
  2. Let the tool parse and validate it.
  3. Run it to measure the encoded sizes.
  4. Compare the compact and pretty byte sizes.

Why use the JSON Size Calculator

Instant

Each result is computed on your device the moment you run the tool.

Private

The text and numbers you enter stay in your browser and are never uploaded.

Free

No signup and no paywall to use any tool in this set.

Works offline

Once the page has loaded it keeps working on a weak or dropped connection.

Built for developers

Plain inputs and outputs you can copy straight into code, configs, or notes.

Honest by design

Conversions and heuristics are for everyday and learning use; verify security-critical output with trusted, official tools.

Common uses

Use it for trimming API response weight

Use it when debugging a large response

Compare uncompressed JSON payload sizes

Use it before shipping a new endpoint

JSON Size in storage-cost planning

Use it for front-end performance work

Technical notes

Reserializing JSON can normalize escape sequences, numeric formatting and duplicate object keys. Large numeric literals also follow JavaScript number precision. Use the input-as-typed count when you need the size of the original pasted text.

JSON Size Calculator reports the UTF-8 byte size of your input and of compact and two-space formatted JSON produced after parsing. It does not estimate gzip compression or transfer time.

Results are reference values; validate against your own environment before relying on them in production.

Because it runs locally, results appear instantly with no server round-trip.

Worked example

The JSON text {"x":"é"} has 10 UTF-8 bytes in compact form and 15 bytes with two-space formatting. The character counts shown use JavaScript UTF-16 code units; these are not byte counts or grapheme counts.

FAQ

Does it measure bytes or characters?

It reports UTF-8 bytes. The displayed character counts are JavaScript UTF-16 code-unit lengths, so an emoji can occupy two units and four UTF-8 bytes.

What if my JSON is invalid?

The tool reports that the input is not valid JSON, along with the parser message, instead of guessing a size.

Why are compact and pretty sizes different?

Pretty-printing adds spaces and new lines for readability, so it takes more bytes than the minified form.

Is my JSON sent to a server?

No. Parsing and measuring happen entirely in your browser and nothing is uploaded.