JSON Formatter & Validator: how to use it
Format, minify and validate JSON with readable error messages. A short guide to common syntax mistakes and when to use each option.
JSON is the standard way applications exchange data, but a response copied from a log or an API is often one long unreadable line, and a single missing comma can break a whole file. The JSON Formatter turns minified JSON into an indented layout, compresses readable JSON back down, and checks that the syntax is valid.
Because your data is processed in the browser, it is safe to paste real API responses, though you should still avoid pasting secrets such as passwords or keys anywhere.
How to use the JSON Formatter & Validator
- Paste your JSON into JSON input.
- Choose the Indentation: 2 spaces, 4 spaces or Tab.
- Press Format to make it readable, Minify to remove all unnecessary whitespace, or Validate to check the syntax only.
- Read the Output, or the error message if the JSON is invalid.
- Press Copy output to copy the result.
Tips for better results
- Keys and strings must use double quotes. Single quotes are not valid JSON.
- No trailing comma is allowed after the last item in an object or array.
- Comments are not allowed in JSON. Remove // and /* */ lines before validating.
- Minified JSON is best for sending over a network; formatted JSON is best for reading and code review.
Typical errors
"Unexpected token" often points to a stray character or a trailing comma near the position shown. "Unexpected end of JSON input" usually means a closing bracket or brace is missing. When the error appears, fix the first one reported and validate again, since later errors are often caused by the first.
Frequently asked questions
Does formatting change my data?
No. Only whitespace changes. Keys, values and order stay the same.
Can it handle large files?
Several megabytes work in most browsers, but very large files can be slow.
Is JSON the same as a JavaScript object?
Not exactly. JSON is stricter: double quotes only, no comments, no trailing commas and no functions.
Open the JSON Formatter & Validator →
Related guides and tools
Text Compare
Compare two blocks of text line by line and see what was added or removed.
Read the guide · Open the toolBase64 Encoder & Decoder
Encode text to Base64 or decode it back, including Unicode text in languages such as Tamil.
Read the guide · Open the toolURL Encoder & Decoder
Percent-encode text for safe use in web addresses and query strings, or decode %20 style text back to readable form.
Read the guide · Open the tool