JSON formatter, validator and pretty printer

Paste JSON to format, minify and validate it, browse it as a tree or convert it to YAML and CSV, all in your browser.

Show as

Top level
–
Input
–
Output
–

How the JSON formatter and validator works

Paste your JSON into the box and the tool checks it straight away. If it is valid, you see the result in the view you choose. If it is not, you get the line and column of the first problem, with the surrounding lines shown so you can spot it.

Everything runs in your browser. Your data is never uploaded, and large inputs are parsed in a background web worker where the browser allows it, so the page stays responsive.

The five views

Why JSON is rejected

The validator follows the JSON standard, which is stricter than JavaScript. The usual culprits are trailing commas, single quotes around strings, unquoted property names and comments. Each error message names the problem where it can. Fix the first error and the next one, if any, appears.

For CSV the top level must be an array. If a row holds a nested object or list, it is written into the cell as JSON text, because CSV cannot nest data.

Copy puts the current result on your clipboard and Download saves it as a file. In tree view, both use the formatted JSON.

Because all the work happens on your device, nothing is stored or sent anywhere. Closing the tab clears your input.

JSON formatter questions

How do I pretty print JSON online?

Paste your JSON into the box and choose Format. The tool pretty prints it with the indent you pick, and you can copy the result or download it as a .json file. It all happens in your browser, so nothing is uploaded.

How do I find the error in my JSON?

The tool validates as you type. If something is wrong, it shows the line and column of the first error with the lines around it, and a button that jumps to that spot in your input. Fix that one and check again, because later errors only show once earlier ones are gone.

Why does my JSON fail when it works in JavaScript?

JavaScript object literals allow things that JSON does not, such as single quotes, unquoted keys, trailing commas and comments. JSON needs double quotes around every string and property name, and no comma after the last item. Change those and it should pass.

Is it safe to paste private data into this tool?

The tool runs entirely in your browser and your JSON is not sent anywhere. As a general habit, avoid pasting passwords or secret keys into any online tool that you do not control.

How do I convert JSON to CSV?

Choose the CSV view. The top level needs to be an array, usually of objects, and each key becomes a column. Nested objects and lists are written into the cell as JSON text, so flatten them first if you want separate columns.