JSON Formatter

    JSON Formatter

    Format and validate JSON data

    2 spaces
    024

    Convert to/from YAML

    Click JSON → YAML to convert the current input, or YAML → JSON to parse YAML input back into formatted JSON.

    JSONPath query

    Supports: $ root, .key, [n], [*], [0,2], [1:3], ..key (recursive descent).

    Provide valid JSON above to query.

    About the JSON Formatter

    A JSON formatter (also called a JSON beautifier or pretty-printer) takes a compact or malformed JSON string and outputs a properly indented, spec-compliant version. It's the first thing every developer reaches for when an API response is hard to read, a config file is broken, or a log entry is minified. This tool validates strictly, reports errors with location hints, and runs fully in the browser.

    Features

    How it works

    1. Paste your JSON — minified, pretty, or malformed.
    2. Pick your indentation (2 spaces is the common default).
    3. The formatted output appears instantly; errors show with line numbers.
    4. Use Minify to compress, or Copy to grab the result.

    Use cases

    Frequently asked questions

    Why won't my JSON parse?

    +

    The JSON spec doesn't allow trailing commas, single-quoted strings, unquoted keys, or // comments. If your file uses any of those, it's JSON5/JSONC, not strict JSON.

    What does minify do?

    +

    Strips all whitespace, producing the smallest valid representation. Useful before embedding JSON in a query parameter or minimizing payload size.

    Does it handle huge files?

    +

    Up to several MB comfortably. For multi-hundred-MB logs, use a streaming parser instead — browsers can't format that much text interactively.

    Can I query specific fields?

    +

    Use a dedicated JSONPath tool for query extraction. This formatter focuses on validation and pretty-printing.

    Is my JSON uploaded?

    +

    No. Parsing happens in your browser — nothing leaves your machine.