Skip to content

Format and validate JSON

Paste JSON to pretty-print it, find errors with their exact line and column, sort keys or minify it, all as you type.

  • Runs in your browser
  • Nothing is sent
  • Works offline

Input

Output

Why format JSON?

APIs and log files usually send JSON as one long line, which is almost impossible to read or debug. Formatting adds indentation and line breaks so you can see the structure at a glance.

Validating at the same time catches the mistakes that break JSON parsers: trailing commas, single quotes, missing commas and unclosed brackets. Each error is reported with its exact line and column.

  • Debugging APIs: paste a response to inspect nested data.
  • Comparing files: Sort keys makes two JSON files line up.
  • Shipping config: Minify removes whitespace for the smallest payload.

How to format JSON

  1. 01

    Paste your JSON

    Paste an API response, config file or any JSON into the input box.

  2. 02

    See it formatted

    The output updates as you type. Errors show the exact line and column so you can fix them fast.

  3. 03

    Copy or save

    Choose 2 spaces, 4 spaces, tabs or Minify, then copy the result or save it as a .json file.

Features

JSON formatter

Pretty-print, validate, sort and minify JSON, with the exact location of any error.

Base64

Encode and decode text and files, including URL-safe Base64 and data URLs.

URL encoding

Percent-encode and decode text, and break any URL into its parts and parameters.

JWT decoder

Read token headers and claims with readable issued and expiry times.

Instant

Results update as you type, with no buttons to press and no waiting for a server.

Private

Nothing you paste leaves your browser, so it's safe for API keys, logs and customer data.

Frequently asked questions

Is my data sent anywhere?

No. Everything runs in your browser, so API responses, tokens and config files never leave your device. It also works offline once the page has loaded.

How do I find an error in my JSON?

Invalid JSON shows a red message with the line and column of the problem. Common causes are trailing commas, single quotes instead of double quotes, and missing commas between items.

What does Minify do?

Minify removes all spaces and line breaks, which makes JSON smaller for sending over a network or storing.

What does Sort keys do?

It orders every object's keys alphabetically, at every level. This makes two JSON files much easier to compare.

More free tools