Skip to content
DeviceCheckHub

JSON Formatter and Validator

Paste JSON to check it, format it, minify it or browse it as a tree. Mistakes are shown with the exact line and column.

Paste or open some JSON and it is checked and formatted here. Nothing is uploaded.

How to format and check JSON

  1. Paste your JSON into Your JSON, or press Open a file to load a .json or text file. You can also drag a file onto the box. Try an example fills it for you.
  2. The tool checks the text as you type. If it is valid, you see Valid JSON and the formatted result on the right, with a count of the objects, lists and keys inside it.
  3. If something is wrong, the box on the right shows the lines around the mistake with a marker under the exact spot, and the message says what is wrong and how to fix it in plain words.
  4. Choose how to see the result, then press Copy result or Download .json. Use result as my text moves the result back into the left box so you can keep editing it.

Formatted, minified and tree views

The most common JSON mistakes

JSON is stricter than the JavaScript it was borrowed from. These are the mistakes people make most often, and the tool names each one with its line and column:

Fix and format

When the mistakes are of the easy kind (comments, trailing commas, single quotes or unquoted keys), a Fix and format button appears next to the message. It repairs your text, formats it and tells you what it changed. This is handy for JavaScript objects copied out of code, or configuration files with comments. It will not guess at anything ambiguous: a missing comma, a missing bracket or an undefined value still has to be fixed by you, and for those Go to the mistake jumps your cursor to the right spot in the left box.

Numbers and text are kept exactly

Many online formatters read your JSON into a program and write it back out, and that round trip can quietly change the data. JavaScript, for example, cannot store the whole number 12345678901234567890 exactly and rounds it, and it writes 1.0 as 1. If those numbers are order IDs or timestamps, the change is a real problem. This formatter keeps every number and every piece of text character for character as you wrote it, and only changes the spacing, plus the order of keys if you choose to sort them. Duplicate keys are kept as well, with a warning, instead of silently dropping one.

JSON is not the same as a JavaScript object

JSON looks like the object syntax of JavaScript, but it is a stricter data format that nearly every language can read. A JavaScript object can have unquoted keys, single-quoted text, comments, trailing commas and values such as undefined; JSON can have none of these. A value in JSON is one of: an object in curly braces, a list in square brackets, text in double quotes, a number, true, false or null. Dates have no special form in JSON; they are usually written as text, such as "2026-10-22".

Tips

Other text tools: tidy capitals with the case converter, count characters with the character counter, or keep notes in the online notepad.

Your JSON stays on your device

JSON often holds private data, so everything happens in your browser: the checking, formatting, minifying and tree view all run on your own computer or phone, and nothing is sent to this website or anyone else. The page remembers your latest text and settings in your browser on this device so they survive a reload. Clear removes the text, and clearing the site’s data in your browser removes everything.

Frequently asked questions

Is my JSON uploaded to a server?

No. The checking and formatting run in your browser, so nothing you paste or open is sent anywhere. That makes it safe for JSON that contains private data such as customer records or API keys. The page keeps your last text on this device so it is still there after a reload; press Clear to remove it.

What does “Fix and format” repair?

It repairs the mistakes that are easy to get right: comments, a trailing comma before a closing bracket, single quotes around text, and keys without quotes, as often found in JavaScript objects. It cannot guess missing brackets, a missing comma between values, or values such as undefined and NaN, so for those the tool shows you the line and column and you fix them yourself.

Does formatting change my numbers?

No. Numbers and strings are copied exactly as you wrote them. Many tools read the JSON into a program first and write it back, which can round a long number such as 12345678901234567890 or turn 1.0 into 1. This formatter only changes the spacing and the order of keys if you ask for sorting.

What is the difference between formatted and minified JSON?

Both mean the same thing to a program. Formatted JSON has line breaks and indentation so people can read it. Minified JSON removes every space and line break to make the file smaller, which is useful when sending it over a network or storing it in a limited space.

Why does it say a key appears more than once?

JSON allows the same key twice in an object, but the result is unreliable: most programs keep only the last value and silently ignore the earlier ones. The tool keeps both in the output so nothing is lost, and warns you so you can decide which one is right.

How big a file can it handle?

A file you open can be up to 5 MB, and pasting works for similar sizes. A few megabytes of JSON formats in a fraction of a second on a normal computer. The tree view shows the first 500 items of each list or object to keep the page quick; the Formatted and Minified views show everything.

Last updated · About DeviceCheckHub