Tech on Tech Global Services
This is taking longer than usual.

JSON Formatter & Validator Online

Free JSON formatter and validator. Beautify or minify JSON, sort keys, and find errors by exact line and column with a clear fix. Runs in your browser.

How to use it

  1. Paste your JSON, open a .json file, or load the sample.
  2. It's validated as you type. If something is wrong you'll see the line, the column and what to fix.
  3. Choose Format (2 spaces, 4 spaces or tabs) or Minify, and optionally sort keys A to Z.
  4. Copy the result or download it as a .json file.

The rules that trip people up

JSON is stricter than the JavaScript it looks like. Keys and text must use double quotes, not single quotes. There can be no comma after the last item in a list or object. Comments aren't allowed, and neither are values such as undefined or NaN. Most ‘invalid JSON’ errors come down to one of these, often in a file edited by hand.

Very large whole numbers can lose precision in many programs, because they're read as floating-point numbers: anything beyond about 9 quadrillion (2⁵³) may come back slightly different. IDs that long are safer stored as text.

Formatted or minified

Formatting with indentation makes JSON easy to read and to compare in version control. Minifying removes all the spaces and line breaks, which makes files smaller for sending over a network but impossible to read by eye. Sorting keys gives the same data the same layout every time, so differences between two files stand out.

Questions people ask

Why is my JSON invalid?

The most common causes are a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, comments, and missing commas between items. JSON is stricter than JavaScript, and the error message here tells you which one it is and where.

Is my data uploaded anywhere?

No. Parsing and formatting happen in your browser with JavaScript. Nothing is sent to a server, so it's safe for API responses, configuration files and data containing personal information.

What does minifying JSON do?

It removes all spaces and line breaks that aren't inside strings. The data stays identical but the file gets smaller, which helps when sending it over a network or storing it.

Why did a large number change after formatting?

JavaScript stores numbers as 64-bit floating point, which keeps about 15 to 17 significant digits. Integers larger than 9,007,199,254,740,991 (such as some database IDs) can be rounded. The tool warns you when it sees them; store such values as strings to keep them exact.

Does sorting keys change my data?

No. JSON objects are unordered, so sorting keys only changes how the text is laid out. Arrays keep their order. Sorted keys make two JSON files much easier to compare.