Developer Tools

JSON Formatter & Validator

Pretty-print or minify JSON and see a plain-language parsing error when the document is invalid.

JSON Formatter & Validator workspace

How to use it

Paste JSON, choose an indent, then Format or Minify. Load example fills the sample. Copy and Download use the result box.

Example

A compact object becomes a two-space indented document.

Input

{"name":"Ada","skills":["math"]}

Result

{
  "name": "Ada",
  "skills": [
    "math"
  ]
}

How it works

The formatter parses the document with the browser JSON parser, then writes it back with the indent you chose. Minify removes insignificant whitespace. Strings, numbers, booleans, null, objects, and arrays are preserved. A trailing comma, a comment, or a single quote is rejected because those are not JSON.

Common errors

  • A trailing comma after the last item Remove the comma. JSON does not allow it.
  • Single quotes around strings Replace them with double quotes.
  • The error mentions a line and column Start at that position. The parser stops at the first problem it can name.

Limitations

Comments, trailing commas, and NaN are outside JSON. Integers larger than the safe integer range can change when parsed. The tool does not sort keys or convert types.

Privacy

The text you paste is processed in your browser. PepsTools does not receive it, store it, or send it to another service.

Questions

Does formatting upload my JSON?

No. Parsing and formatting happen in your browser.

Why did a valid-looking file fail?

JSON is stricter than many config languages. Comments and trailing commas are the usual cause.