Skip to content
Util.Ninja

JSON Formatter and Validator

Paste JSON to beautify it with 2 or 4 spaces or tabs, validate it with the exact line and column of any error, and explore it in a collapsible tree view. Fix JSON repairs comments, trailing commas, single quotes and unquoted keys. Large numbers keep every digit, and your data never leaves the browser.


        
        
      

How to use

  1. Paste your JSON into the left box, open a .json file, or drop a file onto it.
  2. The result appears on the right straight away, and the status bar shows whether the JSON is valid.
  3. If there is an error, the line is highlighted. Press Show me to jump to it, or Fix JSON automatically.
  4. Press Format / beautify to tidy the input itself, or Minify for the smallest version. Choose the indent and sort keys if you like.
  5. Switch to Tree to browse nested data. Click any value to see and copy its path, such as $.items[0].name.

Frequently asked questions

How do I find the error in my JSON?

The validator shows the exact line and column with a short explanation such as “Expected , or } after the property value”. The line number is highlighted in red and “Show me” moves the cursor to the problem.

What does “Fix JSON” repair?

It removes // and /* */ comments and trailing commas, turns single quotes into double quotes, adds quotes around unquoted keys, adds missing commas between values and converts Python-style True, False and None. Then it formats the result.

Will big numbers or decimals change?

No. Many online formatters pass data through JavaScript numbers, which changes integers above 9,007,199,254,740,991. This formatter keeps every number exactly as you wrote it.

Does it warn about duplicate keys?

Yes. Duplicate keys are allowed by the JSON grammar but cause bugs, because most parsers keep only the last value. The status bar warns you and gives the line.

Can it decode a JWT?

Yes. Paste a JSON Web Token and the header and payload are decoded and formatted, with the expiry time shown. The signature is not checked.

Is my JSON sent anywhere?

No. Everything is processed by JavaScript in your browser, so it is safe for API responses, configs and other private data.

What is a JSON formatter?

JSON (JavaScript Object Notation) is the most common format for APIs, configuration files and data exchange. Machines often send it on a single line, which is hard for people to read. A formatter adds line breaks and indentation so the structure is clear. A validator checks that the text follows the strict JSON rules: double-quoted keys and strings, no trailing commas, no comments and only one top-level value.

Need the opposite? The JSON minifier makes JSON as small as possible for production.

More free tools

QR code generatorLinks, Wi-Fi, contacts, PNG & SVGWord & character counterWords, characters, reading timeImage compressor & resizerShrink and resize JPG, PNG, WebPPassword generatorStrong passwords & passphrasesBase64 encode / decodeText to Base64 and backJSON minifierMake JSON smallerJS, CSS & HTML minifierShrink code for faster pagesURL / URI encoderPercent-encode and decodeGUID / UUID generatorUnique IDs in one clickWebP converterJPG, PNG, HEIC to WebPWords FinderUnscramble letters, 10 languages

Need a break? Play a free game → Dots, Hen House Dash and Gold Runner, on phone or PC.