Free · no sign-upChecks as you typeNothing uploaded

JSON formatter and validator

Paste a payload and read it. Format it, fold it, and find the exact character that broke it, all in this tab and none of it sent anywhere.

An error gives the line, the column and the characterDuplicate keys and unsafe integers are flaggedFormatting never rewrites a numberComments and trailing commas fixed in one press
  1. Paste or dropA payload, a config file, a log line. No upload, no button first.
  2. Read the verdictValid, or the line, the column and the character at fault.
  3. Format it or fold itPretty-print, minify, sort, or walk the tree and copy a path.

Your JSON

Result

Nothing to show yet. Paste a payload on the left and the tree appears here.

Waiting for JSON. Everything below happens in this tab.

Nothing is uploaded. A pasted access token, customer record or API response is parsed on your own machine and is gone when you close the tab.

How to format and check a JSON file

  1. Paste your JSON

    Drop it in the box, drag a .json file onto it, or press Open file. There is no upload and no button to press first.

  2. Read the verdict

    Valid or not, on the spot. An error gives the line, the column, the character at fault and the usual cause.

  3. Format it, or explore it

    Pretty-print at 2 spaces, 4 spaces or a tab, minify it, sort every object A to Z, or fold through the tree and copy the path to any value.

What this checks that a parser does not

Running JSON.parse answers one question: does it load. Two things pass that test and still cost you an afternoon.

  • A repeated property name. JSON allows it and every parser keeps the last one, so half your object disappears without an error. The warning here names the path of each one.
  • A whole number above 9,007,199,254,740,991. It parses, and it parses to a different number, because a double cannot hold it. Long IDs are the usual victims.

Neither is a syntax error, so neither stops the document being valid. Both are flagged separately from the verdict for that reason.

Formatting will not touch your data

The formatter works on the text you pasted rather than on a parsed copy of it. Whitespace is rewritten; numbers, strings and escapes are copied through exactly as written. That matters more than it sounds. A formatter that parses and re-serialises turns {"id": 12345678901234567890} into {"id": 12345678901234567000} and says nothing about it.

Sort keys is the one control that does change the file. It reorders the properties of every object, which JSON treats as meaningless and a diff does not, so it is off by default and worth turning on before comparing two versions of the same payload.

What Fix will and will not do

When a document fails to parse for a reason with an obvious mechanical cure, a Fix button appears beside the error and lists what it would change first.

ProblemFixedWhy
// and /* */ commentsYesStripped. A comment cannot be anything else.
Trailing commasYesRemoved before a closing brace or bracket.
'single' and “curly” quotesYesRewritten as double quotes, contents escaped.
Unquoted property namesYesA bare word before a colon can only be a key.
True, False, None, NaNYesLowered, or replaced with null.
A missing commaNoWhere it goes is a guess, and a wrong guess changes your data.
A missing brace or bracketNoSame reason. The nesting it belongs to is unknowable.
Two objects in a rowNoThat is NDJSON, and it needs a reader that expects it.

Reading the tree

Every branch shows how many keys or items are inside it, and folds. Two levels are open when the tree first draws, which is enough to see the shape of a response without scrolling past a page of leaves. The copy button on a row gives you the path to that value in the form you would type it in code, such as $.items[0].sku.

The filter box above the tree matches on keys and on values at once, and keeps the ancestors of anything that matches so a hit is never orphaned. It is the fastest way to answer "does this response contain that field" on a payload too big to scroll.

Keyboard and files

Ctrl + Enter, or Cmd + Enter, formats without reaching for the mouse. Drag a .json file onto the editor to open it, or use Open file. Full screen moves the editor into the whole viewport, and Escape brings it back with your text where you left it.

Frequently asked questions

Is my JSON sent to a server?

No. There is no server to send it to. The page is a static file and the parser runs in your own tab, so an API response with a customer record in it, or a config file with a key in it, never leaves the machine. Nothing is saved either, not even locally, so a reload loses your text.

Why does it warn about duplicate keys when the JSON is still valid?

Because the specification allows a repeated property name and every parser quietly keeps the last one. {"role":"user","role":"admin"} is valid JSON and loads as a single role of admin, with the first value gone and no error anywhere. That is a real bug in real payloads, usually from two bits of code writing the same object. The warning is the only place you will see it.

What is the warning about numbers past the safe integer range?

JSON puts no limit on the size of a number, but JavaScript holds every number as a 64-bit float, so whole numbers above 9,007,199,254,740,991 lose precision. A Twitter or Discord ID pasted here reads back as a different number, and so it does in any language using doubles. The fix is on the API side: send large IDs as strings.

Does formatting change my data?

No. The formatter rewrites the whitespace and copies everything else through character for character, so a 20-digit ID keeps its digits and a string keeps the escapes it was written with. Most online formatters parse and re-serialise, which silently rounds long numbers. Sort keys is the one option that does change the file, by reordering each object, and key order carries no meaning in JSON.

Can it read JSON with comments or trailing commas?

Not as valid JSON, because neither is. It names the problem instead, and offers a Fix that strips comments, drops trailing commas, converts single and curly quotes, quotes bare property names and rewrites True, False and None. Fix never guesses at a missing comma or a missing brace, because a wrong guess changes your data rather than the syntax.

How large a file can it open?

Up to 40 MB from the Open file button, and validation and formatting work at that size. The tree stops drawing above 2 MB, because a few hundred thousand rows makes the page stutter for no gain. Above that limit the Text view still shows the whole document and the error reporting is unchanged.

The error says column 4,812. My file is one line. How do I find it?

Press Format first if the document parses, or use Go to the error, which puts the cursor on the exact character and scrolls the box to it. The excerpt under the message also shows the 78 characters around the fault with a mark under it, which is usually enough to recognise the spot in a minified payload.

Does it work offline?

Yes, once the page has loaded. Nothing on it makes a network request after that, so it keeps validating on a plane or a dead connection. Reload while offline and it comes back only if your browser still has the page cached.

move openesc close