Skip to main content
What you enter is never sent to a server. It is processed entirely in your browser and not stored anywhere.

JSON Formatter & Validator

Paste JSON to format it instantly, or find exactly which line and column breaks it. API responses and config files often contain tokens or personal data, so nothing you paste is sent to a server — it is processed entirely in your browser.

Enter JSON and the formatted output and validation result appear here.

Syntax error ·

    

How to use the JSON formatter

  1. Paste your JSON. Inputs up to 1 MB update as you type; larger inputs are processed only when you press Run, so the page never freezes.
  2. Format indents with 2 spaces, 4 spaces or tabs. Minify strips every optional space and line break. Validate only checks syntax without producing output.
  3. Sort keys A–Z orders object keys by Unicode code point — handy before diffing two documents.
  4. Copy the result or download it as a .json file.

Numbers and strings are copied exactly as written; only whitespace changes. Unlike tools built on JSON.parse, a 64-bit ID such as 12345678901234567890 or a price like 1.50 comes out unchanged. Got a JWT payload or other Base64-encoded JSON? Decode it first with the Base64 decoder (URL-safe supported).

Common JSON syntax errors

JSON (RFC 8259) looks like JavaScript but is much stricter. When the validator points at a position, check these first.

InvalidValidRule
{"a": 1,}{"a": 1}No trailing commas
{'a': 'b'}{"a": "b"}Double quotes only
{a: 1}{"a": 1}Keys must be quoted
// note(remove)No comments
{"zip": 02134}{"zip": "02134"}No leading zeros; store ZIP codes as strings
NaN, undefinednullNot JSON values
True, Nonetrue, nullPython literals must become lowercase JSON

Lines and columns start at 1 and count UTF-16 code units, matching the "Ln, Col" display in editors such as VS Code (an emoji counts as 2 columns).

When to format, minify or sort

Need unique IDs for test fixtures? Generate them in bulk with the UUID generator. Tabular data can go between spreadsheets and text with the Excel to CSV converter.

FAQ

Is my JSON uploaded to a server?

No. Formatting, minifying and validation all happen in your browser. Nothing is sent to a server or stored, so responses containing API keys or customer data are safe to paste. Once the page has loaded it even works offline.

How large a file can it handle?

As much as your device's memory allows — tens of megabytes on a laptop take a few seconds. Above 1 MB the tool waits for the Run button instead of reprocessing on every keystroke.

Does it support JSON Lines (NDJSON)?

Not directly: JSON Lines is several JSON values in a row, which the validator reports as "content after the end of the JSON value". Validate one line at a time, or wrap the lines in [ ] with commas to make an array.

Sources