JSON Formatter

v1

Paste JSON, get it readable, compact, or checked.

Free · No uploads · On-device

Paste JSON above, then pick Format, Minify or Validate only.

Your JSON stays on this page. Sent anywhere: 0.

How it works

Parse, then print

Format parses the input and prints it with 2-space indent. Minify parses it and prints it on one line with no extra spaces. Validate only parses it and reports valid or invalid without changing anything.

When parsing fails, the error message names the line and column where it stopped, so you can find the problem instead of guessing. Duplicate keys keep the last value, which is how JSON parsing works everywhere. Numbers are handled as JavaScript numbers, so integers above 2 to the power of 53 can lose precision.

Guide

Fixing the usual breakage

Questions

Is my JSON sent anywhere?

No. Formatting, minifying and validation all run in your browser, on your device. Nothing is uploaded, saved or sent anywhere.

Why does it say invalid when the JSON looks fine?

The usual causes are trailing commas, single quotes instead of double quotes, unquoted keys, and comments. JSON allows none of those, even though JavaScript objects do. The error message names the line and column where parsing stopped.

Does formatting change my data?

Only the layout changes. Values stay the same. Key order is kept, except integer-like keys, which JavaScript orders numerically. One exception: integers above 2 to the power of 53 can lose precision, because they are handled as JavaScript numbers.

Does it handle large files?

There is no size limit imposed here, but pasting tens of megabytes can get slow, since the whole document is parsed and re-printed in the page.

Only Trusted Finds · ToolsExplainersAboutPrivacy