Your JSON is processed only in this browser tab. Nothing is uploaded or logged.
How to use the json formatter
Paste your JSON into the input box, or press Load sample to try it.
Press Format to beautify it with 2-space, 4-space or tab indentation. Tick Sort keys to order every object alphabetically.
If the JSON is invalid, the status line names the line and column, and the cursor jumps to the problem in the input box.
Press Minify to strip all whitespace for production, then copy or download the result.
What people use it for
Debugging API responsesTurn a one-line response into something you can actually read and scan.
Fixing config filespackage.json, composer.json and app settings fail on one missing comma. Find it in seconds.
Checking schema markupValidate JSON-LD structured data before you paste it into a page.
Shrinking payloadsMinify large JSON files before shipping them with your site.
The JSON errors you will hit most
| Error | Usual cause | Fix |
| Unexpected token } | Trailing comma after the last item | Delete the comma before } or ] |
| Unexpected token ' | Single quotes around strings or keys | Use double quotes: "key" |
| Unexpected token u / N | undefined or NaN pasted from JavaScript | Replace with null or a number |
| Unexpected end of JSON input | Missing closing bracket or brace | Count your { and } |
| Bad control character | A raw line break inside a string | Write it as \n |
JSON in one minute
JSON (JavaScript Object Notation) is plain text for structured data. It has six value types: strings in double quotes, numbers, true, false, null, arrays in [ ] and objects in { }. Keys must be double-quoted strings. Comments are not allowed, and neither are trailing commas. Those two rules cause most of the errors people paste into a JSON validator.
Frequently asked questions
Is this JSON formatter free?
Yes, free with no signup and no size cap beyond what your browser can hold in memory.
Is my JSON uploaded anywhere?
No. Parsing, formatting and validation all happen in JavaScript in your browser tab. That makes it safe for payloads that contain keys or customer data.
What is the difference between a JSON formatter and a JSON validator?
A validator tells you whether the text is valid JSON. A formatter also rewrites valid JSON with clean indentation. This tool does both, and minifies too.
Why does my JSON fail when it works in JavaScript?
JavaScript object literals allow single quotes, comments, trailing commas and unquoted keys. Strict JSON allows none of those.
Can it fix my JSON automatically?
It points to the exact spot so you can fix it in one edit. Guessing fixes silently can change your data, so we leave the edit to you.
Does Sort keys change my data?
No. It only reorders object keys alphabetically. Array order stays as it was, because array order carries meaning.
How big a file can I format?
Files of several megabytes are fine on a desktop. Very large files may be slow to display, so minify or download instead of scrolling the output.