JSON formatter

Format, check and fix JSON, and explore it as a tree. Free, no sign-up, and nothing you paste is saved or sent.

How it works

  1. 1Paste, type or open a fileJSON, JSON Lines, GeoJSON, HAR or any text file.
  2. 2See what's wrong, or that it's validErrors show the line, the column and how to fix them; Repair fixes common mistakes and lists every change.
  3. 3Format, explore and copyFormat or minify, browse the tree, copy any path or value, or download the result.

Questions

Is my JSON uploaded or saved anywhere?

No. Everything happens in your browser, so your JSON never reaches our servers. There's no save button, no share link and no history. If you turn on “Keep on this device”, it's kept only in this browser until you turn it off or clear it.

Is it safe to paste JSON with passwords or API keys?

It never leaves your device, and the page doesn't load anything named inside your JSON. Still, treat secrets with care: clear the box when you're done on a shared computer, and remember that copied text stays on your clipboard.

How do I find out what's wrong with my JSON?

Paste it. If it isn't valid, you see the line and column, a plain explanation and how to fix it. “Go to error” jumps to the spot.

What can Repair fix?

Comments, trailing or missing commas, single or curly quotes, key names without quotes, Python's True/False/None, undefined, line breaks inside text, unfinished JSON, callback(…) wrappers, code fences, MongoDB values like ObjectId(…), and lines of separate objects. It shows every change before you apply it, and Undo takes you back.

Will formatting change my numbers or text?

No. Formatting only changes spaces and line breaks. Big numbers like 12345678901234567890 and decimals like 1.10 stay exactly as you wrote them. (Sorting keys changes the order; escaping changes how characters are written, not what they are.)

Why does it warn about duplicate keys or big numbers?

They're valid JSON, but most apps keep only the last of two keys with the same name, and apps written in JavaScript can't store whole numbers above 9,007,199,254,740,991 exactly.

How do I copy the path to a value?

Click the value in the tree (or put the cursor on it in the text) and choose Copy path. Pick JavaScript (data.users[0].email), JSONPath ($.users[0].email) or JSON Pointer (/users/0/email).

Does it work with JSON Lines (NDJSON)?

Yes. Files with one JSON value per line are recognised: each line is checked, and you can format each line or join them into one array.

How big can the JSON be?

Up to 50 MB on a computer, and up to 20 MB on phones and tablets, so the page doesn't run out of memory. Big files are checked and formatted in the background with a progress bar and a Cancel button.

What does minify do?

It removes all spaces and line breaks, so the JSON takes the least space, for example before putting it in code or a request.

Related tools