JSON Formatter and Validator
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
- Format JSON with adjustable indentation
- Compress JSON into a single line
- Show the line and column of syntax errors
- Sort object keys alphabetically
- Copy or download the result
- Paste JSON: Paste the JSON data you want to inspect.
- Choose an action: Select Format, Minify, or Validate.
- Correct or save: Use the error location to correct invalid JSON, then copy or download the result.
Examples
- Inspect an API response that contains invalid JSON
- Compress JSON before sending it in an HTTP request
- Sort configuration keys to make two versions easier to compare
- Check JSON examples used in documentation
Limitations
- Large JSON over 10 MB may cause noticeable lag
- Comments and trailing commas are not valid standard JSON
- The entered data is processed directly in your browser and is not sent to a server.
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.