JSON Formatter and Validator

Paste JSON to format, check or shrink it.

FreeNo sign-upRuns in your browser

Your JSON

0 characters

Result

Paste JSON to see it here

How to use it

  1. Paste your JSON

    Drop it into the box, or press Sample to see how it works.

  2. Pick format or minify

    Choose the indent size, and turn on key sorting if you want a stable order.

  3. Copy or download

    If the JSON is valid you get the result at once. If not, you see the line and column of the problem.

This JSON formatter and validator makes messy JSON readable, finds the exact spot where it breaks, and can squeeze it down to one line. It works on API responses, config files, package files and log lines. The text never leaves your browser, so it is safe for private data.

Common JSON mistakes and how to fix them

Trailing comma

A comma after the last item in an object or array is not allowed in JSON, even though many programming languages accept it. Delete the comma.

Single quotes

JSON needs double quotes around every key and every text value. Single quotes work in JavaScript objects but not in JSON.

Unquoted keys

{name: "Ana"} is a JavaScript object, not JSON. Write {"name": "Ana"} instead.

Comments

JSON has no comments. Remove lines that start with // or blocks inside /* */ before you paste.

Common questions

Is my JSON sent anywhere?
No. The text is parsed by your own browser. Nothing is uploaded, so you can paste API responses, config files and test data without sending them to a server.
Why does it say my JSON is invalid?
The usual causes are a trailing comma after the last item, single quotes instead of double quotes, a key without quotes, or a missing bracket. The message shows the line and column where the parser gave up, which is normally right next to the real mistake.
What is the difference between format and minify?
Format adds line breaks and indentation so people can read it. Minify removes every space and line break so the file is as small as possible, which is what you want when you send JSON over a network.
Does sorting keys change my data?
It only changes the order of keys inside objects. The values stay the same, and the order of items inside arrays is never touched. Sorted keys make two JSON files easier to compare.
Can it handle large files?
It handles files of a few megabytes without trouble on a normal laptop or phone. Very large files can make the page slow, because everything is kept in memory in your browser.

More free tools

All free tools
Word & Character Counter

Analyze text with real-time word, character, sentence, paragraph, and reading time statistics.

Runs in your browser
URL Slug Generator

Convert titles and phrases into clean, SEO-friendly, URL-safe kebab-case slugs.

Runs in your browser
Base64 Encoder and Decoder

Encode text to Base64 or decode it back. Works with emoji and any language.

Runs in your browser
Text Diff Checker

Compare two texts and see what was added or removed, by line, word or character.

Runs in your browser