JSON Formatter & Validator
Paste JSON to beautify it, minify it or find the exact line and column of a syntax error. Everything runs in your browser, so API responses and config files stay private.
How to format and validate JSON
- Paste your JSON into the input box, or press Sample to try it.
- Choose 2 spaces, 4 spaces, Tab to beautify, or Minify to remove all whitespace.
- If the JSON is invalid, the message shows the line and column of the first error and highlights it in the input.
- Copy the result or download it as a .json file.
What a JSON formatter and validator does
JSON (JavaScript Object Notation) is the text format most web APIs, config files and databases use to exchange data. A formatter re-indents it so nested objects and arrays are easy to read; a minifier strips every optional space and line break to make it smaller; a validator checks that it follows the JSON rules and tells you where it does not.
This tool parses your text with the browser’s own JSON engine, so what it accepts is what JSON.parse accepts. If parsing fails, a separate strict scanner finds the first offending character and reports its line and column and a plain-language reason, because browsers word their own errors differently.
Fixing common JSON errors
- Trailing comma:
{"a":1,}is invalid. Remove the comma after the last property or item. - Single quotes: JSON strings and property names must use double quotes.
- Unquoted keys:
{name:"x"}is JavaScript, not JSON. Write{"name":"x"}. - Comments: JSON does not allow
//or/* */. Remove them before validating. - Special values:
NaN,undefinedandInfinityare not valid JSON values.
Privacy and large files
Your JSON is processed locally and never uploaded, which matters when it contains tokens, customer data or internal configuration. Very large files (tens of megabytes) depend on your device’s memory, and the textarea can become slow to scroll; for those, use a command-line tool such as jq.
Frequently asked questions
How do I format JSON online?
Paste your JSON into the input box, choose 2 spaces, 4 spaces or Tab, and press Format JSON. The beautified result appears below and you can copy or download it.
How do I find the error in my JSON?
Press Format JSON. If the text is invalid, the message gives the line and column of the first problem and explains it, and the input box highlights that spot.
What is the difference between formatting and minifying JSON?
Formatting adds indentation and line breaks for people to read. Minifying removes all optional whitespace so the file is as small as possible for sending over a network. The data is identical.
Does sorting keys change my data?
Sorting reorders object properties alphabetically at every level. JSON objects are unordered, so values are unchanged, but array order is kept exactly as it is.
Is my JSON uploaded to a server?
No. Parsing and formatting happen in your browser. ToolShoppy never receives what you paste.