JSON size calculator — bytes, KB and what takes the space
Paste a JSON object or array to see its exact size in bytes and KB, how much minifying saves, how deep it nests and which keys are the heaviest. Handy before you hit a payload limit. Runs in your browser.
Everything happens in your browser with JavaScript. Nothing you paste is sent to HostKarle or anyone else, so it is safe for API responses, config files and other private data. Shortcut: Ctrl + Enter runs the tool.
How to check the size of JSON
Message queues, serverless functions, push notifications and databases all reject payloads over a fixed size. Measure before you ship instead of after the error.
Paste the JSON
Paste a payload, an API response or a document, or load a .json file of any size.
Calculate
Press Calculate size (or Ctrl + Enter). The JSON is checked first; if it is invalid you see the line and column of the error.
Read the breakdown
Compare the as-pasted, minified and pretty sizes, then use the per-key table to find the field worth trimming, paginating or compressing.
Common JSON size limits
Published limits at the time of writing. Services change them, so check the provider's documentation before relying on a number.
| Where the JSON goes | Limit |
|---|---|
| Apple / Firebase push notification payload | 4 KB |
| AWS SQS / SNS message | 256 KB |
| AWS DynamoDB item | 400 KB |
| Google Firestore document | About 1 MiB |
| AWS Lambda synchronous response | 6 MB |
| MongoDB document (BSON) | 16 MB |
| MySQL max_allowed_packet (default, 8.0) | 64 MB |
| PHP post_max_size (default) | 8 MB (hosts often raise it) |
Making JSON smaller
- Turn on compression. gzip or Brotli on the web server shrinks JSON far more than minifying. Check that your server sends Content-Encoding: gzip or br for JSON responses.
- Drop nulls and empty fields your client never reads.
- Paginate long arrays instead of returning thousands of rows in one response.
- Send IDs, not copies. Repeating the same nested object in every item is a common cause of bloat; the per-key table makes it obvious.
Frequently asked questions
Something not working the way you expect? Message us on WhatsApp at +91 94343 44325. We are a hosting company, so we answer developer questions too.
How do I calculate the size of a JSON object?
Paste the JSON and press Calculate size. You get its size in bytes and KB exactly as pasted, minified and pretty-printed, plus the number of keys, values and levels of nesting, and a table showing how many bytes each top-level key takes.
Are the sizes in bytes or characters?
Bytes, counted as UTF-8, which is how JSON travels over HTTP and how most databases and APIs measure limits. Plain English letters take 1 byte each, but Hindi, Bengali or Tamil letters usually take 3 bytes and many emoji take 4, so a JSON with Indian-language text is bigger than its character count suggests. Both numbers are shown.
Is 1 KB 1,000 or 1,024 bytes here?
1,024 bytes, the way operating systems and most developers count. The exact byte count is always shown underneath, so you can work out the other figure if a service uses 1,000.
Why should I care about JSON size?
Many systems have hard limits: AWS SQS and SNS messages max out at 256 KB, AWS Lambda responses at 6 MB, DynamoDB items at 400 KB, Firestore documents at about 1 MB, push notification payloads at 4 KB, and MySQL's default max_allowed_packet caps what you can insert in one query. Smaller responses also load faster on mobile data.
How much does minifying JSON save?
It removes spaces, tabs and line breaks outside strings. For pretty-printed JSON that is typically 15 to 40 percent. If you serve JSON from your own site, turning on gzip or Brotli compression on the server saves far more, often 70 to 90 percent.
Is my JSON uploaded to measure it?
No. The calculation runs in your browser with JavaScript's TextEncoder. Nothing is sent to HostKarle or any other server.
Which key is making my JSON so big?
Look at the table under the summary. It lists every top-level key (or array item) with its minified size and share of the total, biggest first. To dig deeper, paste just that part back in, or use the JSON path finder to explore it.
More JSON and XML tools
All of them run in your browser, need no sign-up and work on large files. Bookmark the one you use most.
PHP hosting for developers, from ₹99 a month
Pick the PHP version per domain up to PHP 8.3, with MySQL, phpMyAdmin, cron jobs and free SSL in DirectAdmin, on SSD servers. Host Laravel, CodeIgniter or plain PHP APIs. Renews at the same price.
Also on HostKarle: hosting checker · WHOIS lookup · bulk domain search · shared hosting plans