JSON Formatter
Paste JSON to indent it neatly, sort its keys or squeeze it onto a single line. Syntax errors are pointed out with their line and column.
INPUT
OUTPUT
Runs entirely in your browser. Nothing you enter is sent to a server.
How to format JSON
Paste your JSON
Paste an API response, a configuration file or a log line, or open a .json file.
Pick a layout
Choose Format with 2 spaces, 4 spaces or tabs, or Minify to remove all whitespace.
Copy or download
Copy the result or download it as a .json file.
Readable JSON, fewer mistakes
API responses and exported data often arrive as one long line. Indenting shows the structure at a glance, so nested objects, missing fields and wrong types are easier to spot.
When to minify
Minified JSON is smaller, which helps when you paste it into an environment variable, a URL parameter or a request body. The data itself stays exactly the same.
Frequently asked questions
Is my JSON uploaded anywhere?
No. Formatting happens in your browser, so you can safely paste data that contains customer or internal information.
Why does it say my JSON is invalid?
Common causes are a comma after the last item, single quotes instead of double quotes, and comments. JSON allows none of these. The message shows where the problem starts.
Does sorting keys change the data?
No. Key order has no meaning in JSON objects. Sorting only makes two versions easier to compare; arrays keep their order.
Are long numbers kept exactly?
Yes. Numbers are copied exactly as written, so long IDs aren't rounded the way they can be in some formatters.