Skip to main content
Free browser tool

JSON Formatter & Validator

Paste JSON to check its syntax, turn it into readable indented output, or minify it for compact storage. Your data never leaves the browser.

Private by design: your content stays in this browser.

JSON input

Clean output

Paste JSON, load the example, or start typing.

How to format and validate JSON

  1. Paste a JSON object, array or primitive value into the input editor.
  2. Select two spaces, four spaces or tabs for indentation.
  3. Choose Format JSON, Minify or Validate only.
  4. Review the validation message, then copy or download valid output.

What valid JSON looks like

JSON uses objects, arrays, strings, numbers, booleans and null. Property names and strings must use double quotes. A comma separates items but cannot appear after the final item.

This validator follows the browser’s standards-compliant JSON parser. JSON5 features such as comments, single quotes and trailing commas are not accepted.

Formatting versus minifying

Pretty formatting helps during debugging, code review and documentation because nested values are visually grouped. Minification preserves the same parsed data while removing indentation and line breaks, which is useful when payload size matters.

Questions answered

Frequently asked questions​

Is my JSON uploaded anywhere?

No. Parsing, formatting and validation happen locally in your browser. The tool does not send the JSON to Sarvalaya or another service.

What is the difference between formatting and minifying JSON?

Formatting adds indentation and line breaks so people can read the structure. Minifying removes optional whitespace to produce a smaller string for transport or storage.

Why is my JSON invalid?

Common causes include trailing commas, single-quoted strings, unquoted property names, comments, or a missing closing brace or bracket. Strict JSON requires double quotes and does not support comments.

Can this tool repair malformed JSON automatically?

It deliberately does not guess at repairs, because an automatic change can alter your data. It reports the parser error so you can correct the intended value safely.