Developer Tools
JSON Formatter, Validator and Minifier
Paste JSON, format or minify it, and see exactly where a parse error is. Your data never leaves the page.
JSON workspace
0 characters
Paste JSON, then choose Format, Minify or Validate.
This test runs entirely in your browser. Nothing is uploaded or stored on a server.
What this page reads
Paste a JSON document and the tool parses it with the browser's own JSON parser. A successful parse unlocks Format and Minify; a failed one produces the position of the first syntax error. The error position is expressed as a line and column, which is more useful than a character offset when the document spans many lines.
Format prints the document with two-space indentation and a line break between members. Minify removes all optional whitespace. In both cases the statistics line reports characters, lines and the resulting size in kilobytes, so you can see what a payload costs before sending it. Validate does the same parse without touching the output, which is the safe choice when you only need a verdict.
Reading the statistics
The character count is the size of the text, not of the file on disk; encoding and line endings can change the latter. The line count reflects the output, so minifying a document usually reduces it to one line. The kilobyte figure divides by 1024 and is meant for a quick budget check, not for a billing calculation.
Where the tool stops
The formatter does not repair invalid documents. It does not sort keys, convert types or comment the input; each of those would change the data rather than its presentation. It also cannot preserve number precision beyond what the parser supports, so an identifier longer than the safe integer range should be kept as a string in the source document.
For pattern checks on the text inside a payload, the regex test highlights matches as you type. For scheduled jobs that consume JSON, the cron test explains when the job runs, and the device info page helps when a large document is slow because of the machine rather than the payload.
Checking a payload after a failure
The formatter is most useful immediately after an API call fails. Copy the raw response, paste it into the input field and validate it before reading the content. An error page that begins with an HTML tag produces a parse error at the first character, which is the fastest way to discover that the endpoint returned a login screen rather than JSON.
Once the document parses, compare the formatted shape with the fields the client expects. A missing array, a wrapper object added by a gateway or a number that arrived as a string all show up clearly in the indented view and are easy to miss in a one-line response.
Minify at the end when the payload is going to be stored or sent again. The difference between the formatted and minified sizes is a useful budget figure, and the statistics line reports both without changing the values inside the document.
Numbers and identifiers
JSON has one number type, and the browser parser stores it as a double. An identifier longer than the safe integer range can therefore change its last digits when the document is parsed and reprinted. Keep such identifiers as strings in the source, and check the formatted output before copying a document that contains them.
The parser also rejects values that JavaScript accepts, such as NaN and Infinity. A payload containing either is not valid JSON, and the error position points at the token rather than at the surrounding object.
How to use this test
-
Paste your JSON
Drop the document into the Input box, or type a small sample to try the tool.
-
Format it
Press Format to reprint the document with two-space indentation.
-
Minify when size matters
Press Minify to remove whitespace and see the compact size in the statistics line.
-
Validate without changing it
Press Validate to parse the input and report the first error with its line and column.
-
Clear before the next document
Press Clear to empty both boxes so the next paste starts clean.
How to read the numbers
| State | Reported result | Notes |
|---|---|---|
| Valid JSON | Formatted or minified output | Objects and arrays are indented with two spaces. |
| Syntax error | Line and column | The position comes from the browser JSON parser. |
| Empty input | No output | Nothing is sent to a server. |
| Large input | Local processing | Very large files depend on the memory of the device. |
Browser support
| Browser | Support | Notes |
|---|---|---|
| Chrome and Edge | Supported | Current desktop and mobile versions. |
| Firefox | Supported | Current desktop and mobile versions. |
| Safari | Supported | Safari 16 or later recommended. |
| Mobile browsers | Supported | A hardware keyboard is useful for large files. |
Tips
- A trailing comma is the most common syntax error; the reported position points just past it.
- Numbers beyond the safe integer range lose precision when parsed, so check large identifiers.
- Duplicate keys survive a parse but the last value wins, which can hide a mistake.
Frequently asked questions
Is my JSON uploaded?
No. The document is parsed with the browser JSON parser and formatted in the page; nothing is sent or saved.
Why does a valid document show a parse error?
The parser follows strict JSON. Comments, single quotes, trailing commas and unquoted keys are accepted by JavaScript objects but not by JSON.
How large a document can I paste?
There is no fixed limit in the tool, but very large documents are limited by the memory of the device and by how long the browser will block to format them.
Does formatting change my data?
No. Formatting only changes whitespace between tokens. If the input parses, the values are preserved, including the order of object keys.