JSON formatter & validator

Paste messy JSON to make it readable, check it for errors with the exact line and column, or minify it for production.

JSON

Everything happens in your browser. Nothing you type is sent anywhere.

About this JSON Formatter tool

API responses and config files are often a single unreadable line. Formatting adds indentation and line breaks so you can see the structure at a glance.

If the JSON is broken, the validator tells you where: a missing comma, an extra bracket or a quote in the wrong place. Everything runs locally, so it is safe for API keys and private data.

How to use JSON Formatter

  1. Paste your JSON or open a .json file.
  2. Click Format / Beautify, Minify or Validate.
  3. Fix any error shown with its line and column.
  4. Copy the result or download it as a .json file.

Features

Error location

Line and column of the problem.

Indent options

2 spaces, 4 spaces or tabs.

Sort keys

Alphabetical order for easy diffing.

Minify

Smallest possible JSON.

Private

Data never leaves your browser.

Good to know

  • JSON needs double quotes around keys and strings. Single quotes are not allowed.
  • Trailing commas after the last item make JSON invalid.
  • Comments are not allowed in standard JSON.

Frequently asked questions

Why is my JSON invalid?

The most common causes are a missing or extra comma, single quotes instead of double quotes, or a missing closing bracket. The error message shows where it happens.

Is my data sent to a server?

No. Formatting and validation run in your browser.

Can it handle large files?

Yes, files of several megabytes format instantly on most computers.

What does minify do?

It removes all spaces and line breaks so the JSON is as small as possible.

At a glance

Input
JSON text or .json file
Actions
Format, minify, validate, sort
Upload
None, runs in browser

Related tools

More free tools