Fix Strict JSON Before Formatting or Minifying It
Start with the task you actually need to finish
- Debugging why an API response fails to parse in an application.
- Beautifying a minified configuration file before editing it by hand.
- Minifying a JSON payload before shipping it in a production API response.
A practical check before you begin
The input {"enabled": true,} includes a trailing comma and is not strict JSON. Remove it before formatting. A successful earlier parse does not protect later edits; validate the final version you will actually submit.
Follow the workflow and review the result
- Paste your JSON text into the input area.
- Click format to pretty-print it with indentation and syntax highlighting.
- Check the error panel if the JSON is invalid — it points to the exact line and issue.
- Fix the flagged syntax problem in the input and re-validate.
- Switch to minify mode when you need the smallest possible output for production use.
- Copy the formatted or minified result to your clipboard.
Common JSON syntax errors
Trailing commas after the last item, single quotes instead of double quotes, unquoted object keys, and comments are all invalid in strict JSON even though JavaScript itself tolerates similar-looking syntax. The validator catches each of these and reports where they occur.
When to minify versus pretty-print
Minify JSON for API responses and production payloads, where removing whitespace reduces bandwidth and parsing overhead. Keep pretty-printed JSON for configuration files, documentation examples and anywhere a human needs to read or edit it directly.
Nested data and large documents
The formatter handles deeply nested objects and arrays correctly, indenting each level consistently, which is particularly useful for spotting missing brackets in large, deeply nested API responses that would be unreadable in their raw minified form.
Compared to browser dev tools
Browser console JSON viewers are useful but tied to a specific request; this formatter works with any JSON text pasted from anywhere — a file, an email, a log line — without needing to trigger the original network request.
Limits worth knowing before you rely on the output
Strict JSON does not accept JSON5 comments, single quotes, or trailing commas.