Free JSON formatter and minifier API
Paste JSON and choose readable or compact. Only the whitespace between the parts changes, so large numbers, escapes and key order stay exactly as you sent them. The form calls the same free API your code can call, and the result waits in Storage for 24 hours.
curl -s -X POST https://aisenseapi.com/services/v1/json_format \
-H "Content-Type: application/json" \
-d '{"data":"{\"id\":123456789012345678901234567890,\"price\":1.50,\"tags\":[\"a\",\"b\"],\"note\":\"caf\\u00e9\"}","mode":"pretty","indent":2}'
{
"storage_id": "8d564f58-1e87-4697-81c9-3011597e864d",
"storage_url": "https://aisenseapi.com/services/v1/storage/8d564f58-1e87-4697-81c9-3011597e864d",
"sha256_hash": "855db31facc03d7d89934d9647ba6aa870cf70db6ccde072cb2cd4470dd1f63a",
"bytes": 117,
"expire_timestamp": 1790760065,
"expire_datetime": "2026-09-30T09:21:05+00:00",
"content_type": "application/json",
"filename": "result.json",
"operation": "json_format"
}Try it in the browser
This form posts to the same endpoint and shows the stored result. What you enter is sent to aisenseapi.com, and the result is kept for 24 hours at a link that anyone with the link can open.
Only the whitespace changes
The result stored for the example at the top of the page:
{
"id": 123456789012345678901234567890,
"price": 1.50,
"tags": [
"a",
"b"
],
"note": "caf\u00e9"
}
- Numbers keep their exact text. A formatter that reads JSON into numbers and writes it out again turns
123456789012345678901234567890into1.2345678901234568e+29and1.50into1.5. This one moves whitespace between the parts and leaves the parts alone. - Escapes, key order and duplicate keys are kept. Formatting is not a correction; it does not remove a duplicate key or change what the JSON means.
- Pretty uses 2 or 4 spaces and ends with a line break. Compact removes all whitespace outside strings.
- Invalid JSON is refused with 400 and the parser's message, and nothing is stored. So is JSON with more than 127 nested lists or objects. Use the JSON validator to get a stored report instead.
The API
POST https://aisenseapi.com/services/v1/json_format with Content-Type: application/json. The JSON to format goes in as text, in a string.
| Field | Required | Meaning |
|---|---|---|
data | yes | The JSON text, as a string. |
mode | no | "pretty" (default) or "compact". |
indent | no | 2 (default) or 4. |
The result is stored as result.json and served as application/json.
The answer is a Storage link
The endpoint never sends the converted file in its answer. It stores the result for 24 hours and answers with the same fields the Temporary Storage API answers with, plus what the result is:
| Field | Meaning |
|---|---|
storage_id, storage_url | Where the result is. A GET on the URL returns the bytes. |
sha256_hash, bytes | The digest and size of the stored bytes. |
expire_timestamp, expire_datetime | When the result is removed, 24 hours after it was stored. |
content_type, filename | What the result is and the name to save it under. |
operation | The endpoint that made it. |
The id and the expiry in the examples on this page come from a test run and are different on every call. The hash and the size are what the example request gives every time.
Anyone with the link can read the result until it expires, so do not send personal or confidential data. Stored results count against the Storage budget of 80 MB per IP address per day.
Limits
- The request body is at most 256 KB, and the JSON text, escaped inside
data, has to fit inside it. - Lists and objects can be nested at most 127 deep.
- The formatted result is at most 2 MB.
Errors
A refused request stores nothing and answers with error. The endpoint's own refusals also carry fix, a sentence saying what to send instead.
| Status | When |
|---|---|
400 | The body is not a JSON object, a field is missing, unknown or has the wrong type, or the input breaks the rules above. |
405 | The method is not POST. |
413 | The request, the rows or the result is over a limit. |
415 | The Content-Type is not application/json. |
429 | More than 5000 requests from one IP address in 24 hours, or the day's Storage budget is used up. |
503 | The result could not be stored. Try again later. |
Questions
Is the JSON formatter API free?
Yes. No API key, no account and no sign up. The limit is 5000 requests per IP address per 24 hours, and stored results count against the Storage budget of 80 MB per IP address per day.
Does it change large numbers?
No. The formatter moves whitespace and never rewrites a number, so 123456789012345678901234567890 and 1.50 come back exactly as sent.
Does it remove duplicate keys?
No. Duplicate keys, key order and string escapes are kept. Formatting does not change what the JSON says.
What happens with invalid JSON?
The request is refused with HTTP 400 and the parser message, and nothing is stored.
Related tools
- JSON to CSV converter and CSV to JSON converter
- Table matching: compare two tables on key columns
- JSON formatter and JSON validator
- Image converter and image compression for JPEG, PNG and WebP
- Temporary Storage API, where every result is kept for 24 hours