Check a site
Check a website Service status Outages Blog
All tools
Check a websiteBrowse all tools

JSON Formatter

Beautify, validate and minify JSON.

Runs entirely in your browser. Nothing you enter or upload leaves your device.

What the JSON formatter does

JSON is the text format most web APIs, config files and log tools use to pass data around. Machines happily read it as one long line, but people can’t. This formatter indents JSON so you can follow its structure, squeezes it back down to a single line when you need it small, and points to the exact spot where invalid JSON breaks.

Typical uses include reading an API response while debugging, tidying a package.json or settings file before you commit it, checking a webhook payload, or finding the stray comma that stops an app from loading its config.

How to use the JSON formatter

  1. Paste JSON into the left box, or open a .json file.
  2. Press Format to indent it, or Minify to remove all whitespace. Ctrl/⌘ + Enter also formats. Choose 2 spaces, 4 spaces or tabs from Indent.
  3. If the JSON is invalid, the message gives the line and column and the input box selects the problem character.

Understanding the results

The tool checks your JSON as you type. When it’s valid, the status line shows the top-level type, the number of object keys at every level, and how deeply the data is nested, for example “object · 14 keys · depth 3”. That’s a quick way to confirm a response has the shape you expect before you go through it line by line. You can copy the result or download it as formatted.json.

When the JSON is invalid, the message names the problem in plain words, such as a trailing comma before a closing bracket, a key without double quotes, a line break inside a string or a string that’s never closed. The line and column point to where parsing stopped. The real mistake is often just before that spot, for instance a missing comma at the end of the previous line. Fix it and the status switches to “Valid JSON” as soon as it parses.

Questions

What are the most common JSON errors?

Trailing commas, single quotes instead of double quotes, keys without quotes and comments. None of these are allowed in standard JSON.

Does it change my data?

Formatting only changes whitespace. Sort keys A–Z reorders object keys, including those in nested objects. Numbers larger than 2^53 lose precision, as in any JavaScript program.

Is my JSON sent anywhere?

No. It is parsed in your browser, which makes it safe for API responses and configuration files.

My file has one JSON object per line. Why is it invalid?

That layout, often called JSON Lines, holds many separate documents, while this tool expects one. You’ll see an “after the end of the JSON” error at the start of the second line. Paste a single line, or wrap the lines in square brackets with commas between them.

Cookies on UtiBox

UtiBox is free because of ads. Google and its partners use cookies to show, limit and measure ads, Google Analytics, Ahrefs Web Analytics and Microsoft Clarity show us how the site is used, and we use a few essential cookies to run the site.