JSON Formatter and Validator

Format, compress, and validate JSON. See the exact location of syntax errors and optionally sort object keys.

Files and content are processed locally in your browser and are not uploaded to our server.

About this tool

Paste JSON to make it easier to read, compress it into a single line, or check whether its syntax is valid. When an error is found, the tool shows its line and column. Object keys can also be sorted alphabetically to make repeated comparisons easier.

How to use

  1. Format JSON with adjustable indentation
  2. Compress JSON into a single line
  3. Show the line and column of syntax errors
  4. Sort object keys alphabetically
  5. Copy or download the result
  6. Paste JSON: Paste the JSON data you want to inspect.
  7. Choose an action: Select Format, Minify, or Validate.
  8. Correct or save: Use the error location to correct invalid JSON, then copy or download the result.

Examples

Limitations

FAQ

Why does validate fail on trailing commas?
Standard JSON does not allow trailing commas. Remove them or preprocess before formatting.
What does sorting keys do?
It sorts the keys in every object alphabetically, helping repeated formatting produce a consistent result that is easier to compare.
Can I format JSON with Unicode?
Yes. Unicode characters in strings are preserved; special characters are handled according to standard JSON rules.