JSON Formatter
Format, validate, beautify, and minify JSON.
Output
Formatted JSON will appear here.
How to use it
- Paste your JSON into the box.
- Click Beautify to indent it, or Minify to strip whitespace.
- Fix any error shown, then copy the result.
About this tool
The JSON formatter parses your JSON and either pretty prints it with indentation or minifies it to the smallest valid form. If the JSON is invalid, it shows the parser error message so you can find the problem. It uses the browser JSON parser, so it accepts standard JSON only, not relaxed variants with comments or trailing commas.
Examples
Input
{"a":1,"b":[2,3]}Output
Indented across multiple linesInput
Pretty printed JSONOutput
Minified to one compact lineCommon uses
- Make an API response readable
- Validate that JSON is well formed
- Minify JSON to save space
- Reformat config or data files
FAQ
Is my JSON sent to a server?
No. Parsing and formatting run in your browser. Your data never leaves your device.
What happens if my JSON is invalid?
The tool shows the parser error message so you can find and fix the problem.
Can I minify as well as beautify?
Yes. Beautify pretty prints with indentation, and minify strips whitespace for the smallest output.
Related tools
Developer
Base64 Encoder and Decoder
Encode text to Base64 or decode it back.
Open toolDeveloper
Password Generator
Generate strong random passwords with length and character options.
Open toolDeveloper
UUID Generator
Generate v4 UUIDs in bulk.
Open toolDeveloper
URL Encoder and Decoder
URL-encode or decode percent-encoded strings.
Open toolDeveloper
HTML Encoder and Decoder
Encode or decode HTML entities.
Open toolEmbed this tool
Paste this snippet to put the tool on your own site. It runs entirely in the visitor's browser, the same as it does here.