How to format and validate JSON
The JSON Formatter cleans up, validates, and transforms JSON entirely in your browser — nothing is uploaded.
Steps
- Paste your JSON into the left editor.
- Pick an action:
- Format — pretty-prints with 2-space indentation.
- Minify — strips all whitespace into a single compact line.
- Sort keys — recursively alphabetizes object keys (great for diffing).
- Copy the result from the right panel.
Validation
If your JSON is invalid, you'll see a clear error message — and, when your browser provides it, the line and column of the problem. A valid document shows a summary with the total key count and nesting depth.
Tips
- Sorting keys produces a deterministic output, which makes comparing two JSON blobs much easier.
- Everything runs locally, so it's safe to paste sensitive payloads.