Zokilos

JSON Formatter & Validator

Validate JSON syntax, then pretty-print or minify it

What Is This JSON Formatter & Validator?

A tool that checks whether your JSON is valid using the browser's own native JSON parser, then either pretty-prints it for readability or minifies it down to one line — not a regex guess, a real parse.

How to Validate and Format JSON

1

Paste your JSON.

2

Pick an indentation style.

3

Click Validate & Format (or Minify), then copy the result.

Format vs Minify

Format spreads valid JSON across multiple lines with your chosen indentation, so it's easy to read. Minify strips every unnecessary space, tab, and line break down to a single line, for the smallest possible payload — useful before sending JSON over the wire.

Understanding Validation Errors

When the JSON isn't valid, the status badge shows the browser parser's own error message — for most syntax errors this includes the character position where parsing failed, which is enough to find the problem: a missing comma, an unquoted key, a trailing comma, or an unclosed bracket.

Does This Support JSON5, JSONC, or Comments?

No — this validates strict, standard JSON only. Comments, trailing commas, and unquoted keys are all invalid in standard JSON and will correctly fail validation here, even though some JSON-adjacent formats (like JSON5 or JSONC) allow them.

Duplicate Keys and Key Order

Key order within an object is preserved exactly as written. If a key appears twice in the same object, the parser silently keeps only the last value for it — that's standard JSON.parse behavior, not something this tool changes or warns about.

When to Use This Tool

🐞

Debugging an API response

Paste a minified API response to read it properly and spot what's wrong.

⚙️

Checking a config file

Catch a stray comma or missing quote before it breaks a build.

📦

Shrinking a payload

Minify JSON before embedding it or sending it over a slow connection.

Limitations

  • Strict standard JSON only — no JSON5, JSONC, or comments
  • No JSON Schema validation, only syntax
  • Duplicate keys resolve silently to the last value, per the JSON spec

Benefits of Using This Tool

  • Real validation using the browser's native JSON parser
  • Choice of 2-space, 4-space, or tab indentation
  • One-click minify alongside pretty-print
  • Runs entirely in your browser — nothing uploaded to a server
  • Free, with no sign-up required

Frequently Asked Questions

Is this real JSON validation?

Yes. It uses the browser's own native JSON.parse, so a genuine syntax error is reported with the browser's own message, not guessed at with a regex.

Does it tell me exactly where the error is?

It shows the browser parser's own error message, which for most syntax errors includes the character position in the text where parsing failed.

What's the difference between format and minify?

Format (pretty-print) spreads valid JSON across multiple lines with your chosen indentation, for readability. Minify strips all unnecessary whitespace down to a single line, for the smallest possible size.

Does formatting change key order or duplicate keys?

Key order within an object is preserved as written. If the same key appears twice in one object, valid JSON parsers (including this one) silently keep only the last occurrence — that's standard JSON.parse behavior, not something this tool adds.

Does it support JSON5, JSONC, or comments?

No. This validates strict, standard JSON only — no comments, no trailing commas, no unquoted keys. Any of those will fail validation, which is correct behavior for standard JSON.

Is my JSON sent to a server when I use this?

No. Validation, formatting, and minifying all happen entirely in your browser. Nothing you paste here is uploaded anywhere.