Skip to main content
SK Play Labs logoSK Play Labs

JSON Formatter

Prettify, minify, and validate JSON.

Runs entirely in your browser — nothing you enter is uploaded or sent to a server.

It checks that your JSON is well-formed, not that the data is correct — and standard JSON has no comments or trailing commas, so those are flagged as invalid. Read our full disclaimer.

About this tool

Reformats JSON so it's easy to read, collapses it back to a single compact line, and checks that it's valid — pointing to the line and column when it isn't. It's handy for inspecting an API response, tidying a config file, or catching a stray comma before it breaks your build. Everything happens in your browser using the native JSON parser, so you can paste sensitive payloads without them leaving your device.

Try it

Paste {"a":1,"b":[2,3]} and press Format to see it indented across lines. Remove a bracket and it tells you exactly where the JSON breaks.

How to use

  1. 1Paste or type your JSON into the input box (or load the sample).
  2. 2Press Format to pretty-print it with 2-space indentation.
  3. 3Press Minify to strip all whitespace into a compact single line.
  4. 4If the JSON is invalid, read the error message to find and fix the problem.

Features

  • Prettify with clean, consistent indentation.
  • Minify to the smallest valid single-line form.
  • Clear validation errors with line and column when available.
  • One-click copy of the formatted or minified output.

Frequently asked questions

Why does it say my JSON is invalid?

Common causes are trailing commas, single quotes instead of double quotes, unquoted keys, or a missing bracket. The error message points to the position so you can find and fix it.

What's the difference between prettify and minify?

Prettify adds indentation and line breaks so JSON is readable; minify strips all whitespace into the smallest valid single line, which is what you want for sending over the wire or storing compactly. The data is identical either way.

Does it support comments, trailing commas, or single quotes?

No — standard JSON (RFC 8259) requires double quotes and forbids comments and a trailing comma after the last item. Those are common in JavaScript objects but invalid JSON, so they're flagged.

Is my JSON uploaded anywhere?

No. Formatting, minifying, and validating all run in your browser with the built-in JSON parser, so nothing you paste is sent to a server — safe for API responses and config that contains secrets.

Does formatting change my data?

No. Prettify and minify only change the whitespace and layout — the keys, values, and structure stay exactly the same. It re-serialises the parsed data, so key order is preserved as written.

More developer tools

View all