About this tool
Format, check and minify JSON as you type
This tool formats, validates and minifies JSON in your browser as you type. Paste or drop a file and the result is already there, with the indent you choose and the keys sorted if you want. A mistake is shown with its line and column. Your text is never sent anywhere.
The result is there as you type
There is no button to press. The output changes with every key, so you can fix a missing bracket and watch the error go away. Small documents answer in the next frame. Larger ones are worked on in the background, so the page keeps responding while you type, and above 100,000 characters the tool waits for you to press Run.
Pick Format for readable JSON with two spaces, four spaces or a tab for each level. Pick Minify for the shortest form, with no spaces or line breaks. Pick Validate to check the text and get a short summary: what the top level is, how many values it holds and how deeply it nests.
Errors tell you where to look
When the text is not valid JSON, the first problem is shown with its line and column and a plain reason: a comma missing between two properties, a comma left before a closing bracket, single quotes where JSON wants double ones, a comment, a key without quotes, or a string that never ends.
The words are the same in every browser, since the tool reads the text itself instead of relying on the browser’s own messages. Show in input selects the spot, so you can type over it.
Nothing is rounded or rewritten
Numbers and strings come out exactly as they went in. A number with twenty digits keeps all twenty, where a script that reads and writes JSON would round it. An escape like \u00e9 stays an escape. Keys keep their order, and a key that appears twice is kept rather than silently dropped; Validate points it out.
Sort keys puts the keys of every object in alphabetical order, by character code, which is handy for comparing two documents. The same setting orders the columns of a CSV and the keys of YAML when you convert.
Turn JSON into a table or YAML
To CSV writes a list of objects as rows and columns for a spreadsheet, and To YAML writes the same data as YAML for a configuration file. Both are modes of this page, and each has its own page with a guide to what it does with nested data: JSON to CSV and JSON to YAML.
Your text stays on your device
The text you type or drop is worked on in this page and nowhere else. It is not sent to a server, not saved, and never put in the address of the page, so a link to this tool opens it empty. If you close the tab it is gone.
How it works
-
Step 1:Paste or drop your JSON
Type, paste with Paste, open a .json file or drop one on the page. Example fills in a small document to try.
-
Step 2:Choose a mode
Format, Minify or Validate. For Format, choose two spaces, four spaces or a tab, and whether to sort keys.
-
Step 3:Copy or save the result
Copy puts it on your clipboard. Download saves a .json file named after the file you opened, or data.json.
Questions, answered
How do I format JSON?
Paste it into the Input box with Format selected. The formatted JSON appears in the Output box straight away, with two spaces for each level unless you choose four spaces or a tab.
How do I find what is wrong with my JSON?
Look under the boxes. The first error is shown with its line and column and a reason in plain words. Press Show in input to select the spot, fix it, and the result appears as soon as the JSON is valid.
What does minify do?
It removes every space and line break that JSON does not need, giving the shortest text with the same data. Use it before putting JSON in a URL parameter, a config value or a request.
Does it change my numbers?
No. Numbers are written back exactly as you wrote them, so very large numbers, long decimals and forms like 1E+5 keep every digit. Tools that read and write JSON as code values round them.
Is there a size limit?
You can open files up to 20 MB. Up to 100,000 characters the result updates as you type; above that you press Run. Nesting deeper than 1,000 levels is refused with an error.
Is my JSON sent to a server?
No. The text is worked on inside this page, on your device. It is not saved and not put in the page’s address, so sharing the link shares nothing you typed.