JSON Formatter & Validator
Format, validate, and minify JSON directly in your browser.
- Browser based
- Local processing
Your input and output stay in your browser. Nothing is sent to a server.
What is JSON Formatter & Validator?
JSON Formatter & Validator is a browser-based tool for formatting standard JSON into readable, indented text or minifying it into a compact form. Both operations check JSON syntax and report invalid input.
How to use
Format
- Paste JSON into Input.
- Select 2 spaces or 4 spaces for indentation.
- Press Format and review Output.
Minify
- Paste JSON into Input.
- Press Minify to remove unnecessary whitespace from the JSON structure.
Use Copy to copy Output. Sample loads example JSON for you to try with Format or Minify. Clear empties both editors and resets any error or copy message.
Supported JSON
- Objects and arrays, including nested objects and arrays.
- String roots such as
"hello"and number roots such as30. - Boolean roots (
trueorfalse) and anullroot. - Unicode text and valid escaped strings, including
"line\nbreak".
Example
Input
{"name":"kim","age":30,"skills":["Java","Spring"]}Formatted (2 spaces)
{
"name": "kim",
"age": 30,
"skills": [
"Java",
"Spring"
]
}Validation
Format and Minify validate input with the standard JSON.parse() parser. Invalid JSON produces an error and is not automatically repaired. Object keys and strings must use double quotes; trailing commas and comments are not allowed.
These examples are invalid JSON:
{name:"kim"}
{"name":"kim",}
{'name':'kim'}
{"name":"kim" /* comment */}Current limitations
Numbers follow JavaScript number precision limits. Very large JSON integers above Number.MAX_SAFE_INTEGER (9007199254740991) may lose precision when parsed and written back to JSON.
JSON5, JSONC, and JSON with comments are not supported.
Privacy
Formatting, validation, and minification run locally in your browser. Your input and results are not sent to or stored on a server. Read our Privacy Policy for details.