About the JSON Formatter & Validator
Paste raw or minified JSON and this tool turns it into readable, indented JSON, or squeezes it onto one line. It also checks that the JSON is valid and tells you what is wrong when it is not. Everything runs in your browser, so the data you paste is never uploaded.
How to use it
- Paste your JSON into the Input box.
- Press Format to indent it, or Minify to remove all extra whitespace.
- Choose 2 spaces, 4 spaces or a tab for the indent.
- Copy the result from the Output box.
Features
- Validates as you format and shows the parser's error message when the JSON is invalid
- Choice of indentation: 2 spaces, 4 spaces or tabs
- Minify to a single line for configs, URLs and test fixtures
- One-click copy
- Runs locally in the browser: nothing is sent to a server
Frequently asked questions
- Is my JSON uploaded anywhere?
- No. Formatting and validation happen entirely in your browser, so API responses and config files with sensitive values stay on your machine.
- Why does the tool say my JSON is invalid?
- Strict JSON does not allow trailing commas, single quotes, unquoted keys or comments. The error message points at the first problem the parser found; fix it and format again.
- What is the difference between formatting and minifying?
- Formatting adds line breaks and indentation so people can read the data. Minifying removes them to make the data as small as possible. Both keep the same values.
Part of Octodius' free developer tools. Everything here runs in your browser.