Developer tool · browser-only
JSON formatter and minifier.
Turn compact or messy JSON into readable, indented data. Minify it again when you need a smaller payload.
Develop
JSON formatter
Paste valid JSON below, choose an indentation style, and format or minify locally.
Your formatted JSON will appear here.
A JSON formatter that runs entirely in your browser
JSON is the everyday language of APIs, config files, log lines, and saved application state, but the moment it is compact or hand-edited it becomes hard to read. This formatter takes any valid JSON, parses it with the browser's own JSON.parse engine, and prints it back with clean indentation, so you can see the structure at a glance. Press Minify and it does the reverse: the same data with every optional space and line break removed, ready to drop into a request body or an environment variable. Nothing is uploaded. The parsing and serializing happen on this page, on your device, which is why it stays fast even with large payloads and safe even with data you would never paste into a random online service.
When a JSON formatter earns its place
A few situations come up again and again:
- Reading an API response. You copied a one-line response out of the network tab or a
curlcommand and need to see which fields are nested where. - Fixing a config file. A
package.json,tsconfig.json, or CI config throws a parse error and you need to find the stray comma or missing brace. - Shrinking a payload. You are pasting JSON into a query string, a webhook test, or a database column and want it minified to the smallest valid form.
- Diffing two objects. Formatting both sides with the same indentation makes a line-by-line comparison actually meaningful.
- Sharing an example. Pretty-printed JSON in a ticket or a code review is far easier for a teammate to scan than a wall of text.
Format vs. minify: which one do you need?
Use Format while you are reading or editing. Indentation and line breaks turn nesting into something your eye can follow, and you can switch between two- and four-space indentation to match your project's style. Use Minify when the JSON has to travel: an HTTP body, a log field, a cookie, or anywhere byte count matters. Minifying does not change the data, only its whitespace, so the parsed result is identical.
The same object, formatted:
{
"id": 42,
"name": "Pico",
"tags": ["small", "fast"],
"active": true
}
...and minified:
{"id":42,"name":"Pico","tags":["small","fast"],"active":true}
What counts as valid JSON
JSON is stricter than the object syntax you write in JavaScript. Keeping these rules in mind prevents most parse errors:
- Property names must be wrapped in double quotes. Single quotes and unquoted keys are not allowed.
- Strings use double quotes too. A single quote inside a value is fine; a double quote must be escaped as
\". - No trailing commas. The comma after the last item in an object or array is invalid, even though most editors tolerate it in JavaScript.
- No comments. JSON has no
//or/* */. Strip them before parsing. - Values are limited to strings, numbers,
true,false,null, arrays, and objects. Noundefined, no functions, no dates as literals. - Numbers use a plain decimal form. Leading zeros,
NaN,Infinity, and hex are all rejected.
Common JSON errors and how to fix them
When parsing fails, the browser's own error message is shown below the output. Here is what the most frequent ones usually mean:
| Error message | Usual cause | Fix |
|---|---|---|
Unexpected token } in JSON | A trailing comma before the closing brace or bracket. | Remove the comma after the last property or element. |
Unexpected end of JSON input | A brace, bracket, or quote was never closed. | Count your opening and closing symbols; the payload is cut off. |
Expected property name or '}' | An unquoted key, or a stray comma right after {. | Wrap keys in double quotes and remove leading commas. |
Unexpected token ' in JSON | Single quotes used for keys or strings. | Replace every single quote with a double quote. |
Bad control character in string | A raw line break or tab inside a string value. | Escape it as \n or \t. |
Privacy: your JSON never leaves this page
Because the work is done with the browser's native parser, no request is made to PicoBento or anyone else when you format or minify. That matters when the JSON contains access tokens, personal records, internal API shapes, or anything else you would not want stored on a stranger's server. You can confirm it yourself: open the network tab, format some JSON, and watch that no request goes out.
Frequently asked questions
Can it handle JSON with comments or trailing commas (JSON5)?
No. Standard JSON forbids both, and this tool uses the strict native parser. Remove comments and trailing commas first, or convert from JSON5 in your editor before pasting.
Does minifying change my data?
No. Only whitespace is removed. The parsed object is byte-for-byte equivalent, so a server reading it gets exactly the same values.
Will it sort or reorder my keys?
No. Key order is preserved exactly as you pasted it. Formatting only adds or removes whitespace.
Is there a size limit?
There is no fixed cap, but very large documents (tens of megabytes) depend on your device's memory since everything runs locally. For everyday API responses and config files it is instant.
Why does a big number lose precision?
JSON numbers are parsed as double-precision floats, so integers beyond 2^53 can round. If you need exact large integers, keep them as strings in your JSON.