Paste JSON to make it readable, shrink it, or check that it is valid. If something is wrong, the tool tells you the line and column and puts your cursor right where the problem starts.
Your JSON stays in your browser, so it is safe to paste API responses and config files.
How to use the JSON formatter
- Paste your JSON into the left box, or press Load an example to see how it works.
- Press Format to indent it with 2 spaces, 4 spaces or tabs.
- Press Minify to strip the spaces and line breaks for the smallest size.
- Press Copy result to copy the output. On a keyboard, Ctrl+Enter or Cmd+Enter formats straight away.
What it does
- Formats JSON with your choice of indent.
- Minifies JSON and shows the size before and after.
- Validates JSON against the standard and points to the line and column of the first error.
- Counts the lines and the objects and arrays in your data.
Common JSON mistakes
A comma after the last item in an object or array. JSON does not allow it, even though JavaScript does.
Single quotes around keys or text. JSON needs double quotes.
Keys without quotes, comments, and values such as undefined. None of these are valid JSON.
Frequently asked questions
Is it safe to paste private data?
The tool runs in your browser and does not upload anything. Even so, avoid pasting passwords or keys into any website unless you need to.
Why does it say my JSON is invalid when it works in my code?
JavaScript accepts some things JSON does not, such as trailing commas, single quotes and comments. JSON has a stricter set of rules.
Does formatting change my data?
No. Formatting and minifying only change spaces and line breaks. The keys and values stay the same.
Related tools
- Free Schema Markup Generator Make JSON-LD schema for articles, FAQs, breadcrumbs, organizations, local businesses, products and web apps.
- Free Case Converter Online Change text to sentence case, Title Case, UPPER or lower case in one click.
- Free Password Generator Make strong random passwords from 6 to 64 characters.