Your files never leave your deviceNo uploads, no sign-up, no ad trackingFree, and works offline after your first visit
EN ▾

JSON Formatter

Runs in your browser. Your files never leave your device.

How to use JSON Formatter

  1. Paste your JSON.
  2. Pick an indent size, or choose Minify.
  3. Copy the formatted result, or read the error message to fix invalid JSON.

Common uses

About this tool

Paste JSON to validate and pretty-print it with 2 spaces, 4 spaces or tabs, or minify it to a single line. If the JSON is invalid, you see the parser's error message so you can find the problem. Parsing uses your browser's built-in JSON engine, so private API responses and config files stay on your device.

Worked example

The one-line text {"name":"Ana","tags":["a","b"]} is formatted with 2-space indentation so each key sits on its own line, which makes nested data easy to read. Minifying does the reverse and removes the spaces to save bytes.

Common problems and fixes

Unexpected token at position N.
Look just before the position the error names. The most common causes are a missing comma between items and a missing quote.
Trailing comma.
JSON does not allow a comma after the last item in an object or array, even though JavaScript does.
Single quotes or unquoted keys.
JSON needs double quotes around both keys and strings. Replace 'a' with "a".
Comments are rejected.
Standard JSON has no comments. Remove // and /* */ before validating.

JSON compared with similar formats

FormatCommentsBest for
JSONNoAPIs and data exchange; strict and widely supported
YAMLYesConfiguration files that people edit by hand
CSVNoFlat tables of rows and columns

Next steps

Frequently asked questions

Why does my JSON show an error?

Common causes are trailing commas, single quotes instead of double quotes, and unquoted keys. The message shows what the parser found.

Is my JSON sent anywhere?

No. It is parsed by your browser's built-in JSON engine.

Does formatting change my data?

No. Only whitespace changes; numbers and strings are preserved, apart from JavaScript's usual number precision limits.

Are my files uploaded to a server?

No. Everything runs inside your browser on your own device, so your files and text are never sent anywhere.

Is it really free?

Yes. There is no sign-up, no watermark and no limit on how often you use it.

Does it work on my phone?

Yes. It works in any modern browser on phones, tablets and computers. Very large files may be slow on older phones.

Related tools