JSON formatter and validator – pretty print, minify, find errors
Paste JSON to format it with clean indentation, minify it to one line, sort keys or validate it. If something is wrong, see the exact line and column of the error and a hint on how to fix it. Nothing is uploaded.
How to use the JSON formatter
- Format – pretty prints JSON with 2 spaces, 4 spaces or tabs so it is easy to read.
- Minify – removes all whitespace to make the JSON as small as possible for APIs and config files.
- Validate – checks the syntax and shows the exact line and column of any error.
- Sort keys – orders object keys alphabetically, which makes two JSON files much easier to compare in our Diff Checker.
The most common JSON errors
Most invalid JSON comes from a handful of mistakes: a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, comments, or a missing comma between two values. JavaScript allows some of these, but JSON does not. When the validator finds an error, it highlights the position in your input and suggests a fix.
JSON syntax in one minute
JSON has six value types: strings in double quotes, numbers, true, false, null, objects in { } and arrays in [ ]. Object keys are always strings in double quotes, and items are separated by commas with no comma after the last one.
Working with Android or Kotlin?
Once your JSON is valid, turn it into data classes with our JSON to Kotlin converter – read how to convert JSON to Kotlin data classes for the details.
Frequently asked questions
Is my JSON uploaded anywhere?
No. Formatting and validation run entirely in your browser, so you can safely paste API responses and config files.
How do I find the error in my JSON?
Click Validate. The tool shows the line and column of the first error, highlights it in your input and suggests the most likely fix.
What is the difference between format and minify?
Format adds line breaks and indentation for reading. Minify removes all unnecessary whitespace to make the file smaller.
Can JSON have comments?
No. Standard JSON does not allow comments. Remove them, or use a format such as JSONC or JSON5 if your tool supports it.
How large a file can I format?
Files up to about 20 MB work in most browsers. Very large files may be slow on older phones.
Can the tool fix broken JSON?
Often, yes. When the JSON is invalid because of common mistakes – single quotes, keys without quotes, trailing commas, // or /* */ comments, or Python values like True and None – a “Fix it for me” button appears. One tap corrects these and formats the result. Always check the fixed data, especially for missing commas or brackets, which cannot be guessed.
How do I find the path to a value in a big JSON?
Turn on “Tree view”. The JSON is shown as a collapsible tree; click any key to copy its path, such as $.user.roles[0] – handy for JavaScript, jq or API tests.
Need a website or app built?
We design and build websites and Android apps for clients worldwide – clear scope, fixed price, fast delivery.
Techpass Master Technologies · Websites, Android apps and digital marketing
