JSON Formatter
runs in your browserno sign-upfree
Format, validate and minify JSON with clear error messages.
Valid JSON · formatted
About this tool
This JSON formatter turns compact or messy JSON into clean, indented text that is easy to read, and checks that it is valid at the same time. You can also minify JSON to make it as small as possible, or sort object keys alphabetically to compare two documents. Everything happens in your browser, so API responses, config files and other data never leave your device.
How to use
- Paste or type your JSON into the Input box. It is formatted as you type.
- Choose Format or Minify, pick an indent of 2 spaces, 4 spaces or a tab, and optionally sort keys.
- If the JSON is invalid, the status line shows the problem and, where possible, the line and column.
- Copy the result or download it as a .json file.
FAQ
Is my JSON sent to a server?
No. Formatting and validation run entirely in your browser. Your data is not uploaded or stored anywhere except your own browser.
What is the difference between Format and Minify?
Format adds line breaks and indentation so people can read the JSON easily. Minify removes all unnecessary spaces and line breaks to make the file as small as possible, which is useful for sending data over a network.
Why does my JSON show an error?
Common causes are a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, or comments. JSON does not allow any of these. The status line shows what went wrong and where.
What does "Sort keys" do?
It reorders the keys of every object alphabetically, including nested objects. Arrays keep their original order. This makes it easier to compare two JSON documents.
Does the tool remember my input?
Yes. Your last input is saved in this browser so it is still there when you come back. Press Clear to remove it.