How to beautify and validate JSON
Three steps, usually under a minute.
1
Add your JSON
Paste JSON into the Input panel, drop a .json file onto it, upload a file or load the sample. The status bar validates as you type and shows the exact line and column of any syntax error.
2
Fix errors if needed
Click Go to error to jump to the problem, or click Repair to fix trailing commas, single quotes, unquoted keys, comments and missing commas automatically.
3
Beautify, minify or sort
Choose an indentation and click Beautify, Minify or Sort keys. Explore the result as code, tree, form or view, then copy it or download a .json file.
Which action should you use?
Every action reads the Input panel and writes to the Output panel, except Repair, which fixes the input in place.
Common JSON errors and how to fix them
JSON is stricter than JavaScript. These are the mistakes the validator reports most often.
Repair guesses what you meant. Always check the repaired input before using it, especially for values that were cut off or unquoted.
Built for everyday JSON work
Useful whether you are debugging an API, editing config or cleaning up output from an AI model.
✓
Formatting that never changes data
The formatter rebuilds text from the original tokens instead of round-tripping through JavaScript numbers, so IDs above 2^53 and escapes like \u00e9 stay exactly as written.
✓
Tree editing with search
Switch the output to Tree to collapse large responses, search keys and values, drag nodes, sort arrays or run a transform query, then copy the result.
✓
Nothing to lose
Your input is saved as a draft on this device, the last 20 formatted inputs are in History, and dark mode, indentation, view and wrap settings are remembered.
Frequently asked questions
Answers to the questions people ask most about formatting and validating JSON.
Is my JSON uploaded to a server?
No. Formatting, validation and repair all run in your browser with JavaScript, so your JSON never leaves your device. The editor panels are also masked from analytics session recordings.
What is the difference between beautify and minify?
Beautify adds line breaks and indentation so JSON is easy to read and review. Minify removes all optional whitespace so the same data is as small as possible for network requests and storage. Both keep the data identical.
How do I find the error in invalid JSON?
The status bar under the Input panel validates as you type and reports the line, the column and a plain-English reason, such as a trailing comma or a property name without double quotes. Click Go to error to move the cursor to that position.
What does Repair JSON fix?
Repair fixes trailing commas, single quotes, curly quotes, unquoted property names, JavaScript comments, missing commas, Python True, False and None, unescaped line breaks inside strings, missing closing brackets and JSONP wrappers. NaN and undefined are turned into strings, and numbers with leading zeros are not repaired. Always review the result.
Does beautifying change my data?
No. Beautify, Minify and Sort keys rebuild the text from the original tokens, so key order, string escapes and large integers such as 9007199254740993 are kept exactly in the Code output. Only Sort keys changes the order of object keys. Tree, Form and View use JavaScript numbers, so integers larger than 253 may be rounded in those views.
How do I sort JSON keys alphabetically?
Click Sort keys. Object keys are sorted A to Z at every nesting level and the result is beautified with your chosen indentation. The order of items inside arrays is not changed, because array order is part of the data.
What do Escape and Unescape do?
Escape minifies your JSON and wraps it in a JSON string literal, escaping quotes and backslashes, so it can be embedded in another JSON field, an environment variable or source code. Unescape does the reverse: it takes stringified JSON such as a log line or database value and returns the formatted object.
What are the Code, Tree, Form and View modes?
Code is an editable text editor with syntax highlighting and folding. Tree is an editable, collapsible outline with search, where you can add, remove, move and sort nodes. Form lets you edit values but not the structure. View is read-only, which is useful for exploring large responses safely.
How large a JSON file can I format?
Files up to 10 MB can be loaded. Formatting a few megabytes takes well under a second on a modern device, while the Tree, Form and View modes are slower on very large documents, so use Code output for big files.
Is my work saved?
Your current input is saved as a draft in this browser and restored when you come back, and the last 20 inputs you formatted are kept in the History panel. Both use localStorage on your device only and can be cleared at any time.
Is the JSON Beautifier free?
Yes. It is completely free, needs no sign-up and has no daily usage limit.