JSON Formatter

    Format, validate, and minify JSON in your browser with indentation controls, syntax errors, and simple structure stats.

    Format, validate, and minify JSON

    Use this JSON formatter to paste a raw API response, webhook payload, config fragment, or minified JSON string and turn it into readable output.

    • Pretty-print JSON with 2 spaces, 4 spaces, or tabs.
    • Validate syntax with the browser's standard JSON.parse behavior.
    • Minify valid JSON back to a compact single-line string.
    • Check key count, nesting depth, and byte size after parsing.

    Standard JSON parsing

    The formatter uses standard `JSON.parse` and `JSON.stringify`. That means JSON5, JSONC comments, trailing commas, unquoted keys, and undefined values are not accepted as standard JSON.

    space is 2 spaces, 4 spaces, or a tab character.

    Valid JSON syntax does not prove that the payload matches a specific API schema. It only proves that the text can be parsed as JSON.

    Browser-side privacy note

    Formatting runs in the browser through built-in JSON APIs. Avoid pasting secrets, tokens, credentials, or personal data on shared devices because clipboard history, extensions, and local logs may still expose them.

    Frequently Asked Questions

    Sources and References

    Calculations are based on the listed reference sources. Links open in a new tab.

    Updated:

    Related Tools