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

  1. Paste your JSON

    Drop the document into the Input box, or type a small sample to try the tool.

  2. Format it

    Press Format to reprint the document with two-space indentation.

  3. Minify when size matters

    Press Minify to remove whitespace and see the compact size in the statistics line.

  4. Validate without changing it

    Press Validate to parse the input and report the first error with its line and column.

  5. Clear before the next document

    Press Clear to empty both boxes so the next paste starts clean.

How to read the numbers

JSON states and what the tool reports Checked 2026-11-27 · Test Do It reference values
StateReported resultNotes
Valid JSONFormatted or minified outputObjects and arrays are indented with two spaces.
Syntax errorLine and columnThe position comes from the browser JSON parser.
Empty inputNo outputNothing is sent to a server.
Large inputLocal processingVery large files depend on the memory of the device.

Browser support

Browser support for the json formatter Checked 2026-11-27 · Test Do It checks in current browser versions
BrowserSupportNotes
Chrome and EdgeSupportedCurrent desktop and mobile versions.
FirefoxSupportedCurrent desktop and mobile versions.
SafariSupportedSafari 16 or later recommended.
Mobile browsersSupportedA 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.