Paste JSON to pretty-print, minify, and validate it instantly in your browser.
Updated
/ 5 - Be the first to rate this tool Thanks for rating!
Verification failed - please try again.
Quick check
Please verify you're not a robot to submit your rating.
Give feedback
Tell us what you think about Format and validate JSON online.
- Runs entirely in your browser — your JSON is never sent to a server
- Pretty-print, minify, and validate, with the exact error location highlighted
- Free, no account required
How it works
-
1
Paste your JSON into the Input box.
-
2
Choose 2 spaces, 4 spaces or Tab from Indent.
-
3
Press Format to pretty-print it, or Minify for one line.
-
4
Fix any error shown, then copy the output or share a link.
About the JSON Formatter
API responses, log lines and config exports often arrive as one unbroken line of JSON that nobody can read. This formatter parses what you paste with the browser's own JSON parser, then writes it back out with consistent indentation, or squeezes it onto a single line when you need it compact. If the input is not valid JSON, it shows the parser's error message instead of guessing at a fix.
What you can do
- Pretty-print JSON with 2 spaces, 4 spaces or tabs, chosen from the Indent menu.
- Minify a document to one line with all whitespace between tokens removed.
- Find syntax problems: the error from the parser names what went wrong, such as an unexpected token or an unterminated string.
- Use the line numbers beside the input to locate the problem the error describes.
- Copy the result, or press Share link to get a URL that reopens the tool with your JSON and indent setting.
When it works best
- Reading a minified response copied from the browser network tab or a curl command.
- Checking that a hand-edited config file, such as package.json or a settings export, still parses before you commit it.
- Shrinking a JSON payload before pasting it into an environment variable or a test fixture.
Things to know
- Parsing and formatting happen in your browser. A shared link carries the JSON inside the URL fragment, so only share links for data you are happy to pass on, and very large inputs are refused for sharing.
- The parser follows strict JSON: comments, trailing commas and single-quoted strings are reported as errors rather than repaired.
- Key order is kept as written; nothing is sorted. Very large integers beyond JavaScript's safe range can lose precision when reformatted.
- To check the structure against rules rather than just syntax, use the JSON Schema Validator. To turn JSON into code types, use JSON to TypeScript/PHP.
Frequently asked questions
Yes, pick 2 spaces, 4 spaces or tabs from the Indent menu, or Minify to a single line.
No. Strict JSON rules apply, so comments, trailing commas and single quotes are reported as errors.
No, keys stay in the order you wrote them. Integers beyond JavaScript's safe range may lose precision.
The JSON travels inside the URL fragment, so anyone with the link can read it. Very large inputs cannot be shared.