Skip to content
Developer Tools

JSON Formatter & Validator

Format, minify, sort, and validate JSON locally with clear syntax feedback.

Loading this local tool…

Data handling

Storage and export controls

Retention
The tool's working state is kept only while this page is open. Inputs and results are not saved to persistent storage by Got A Tool.
Export
The tool may prepare a result after you run it. It downloads or copies it only when you choose that action.

Advertising and analytics are separate site services. We do not send selected tool input to them. Read the Privacy Policy for details.

How it works

Format JSON after validating the data it actually contains

Use the formatter to make standard JSON easier to read, compare, copy, or download. It parses the input first, so an error remains visible instead of producing a plausible-looking but broken copy.

  1. Step 01

    Paste JSON

    Add one JSON value: an object, array, string, number, boolean, or null.

  2. Step 02

    Choose the rewrite

    Format with two spaces, four spaces, or tabs; optionally sort object keys; or minify the parsed value.

  3. Step 03

    Review then copy

    Use the reported root type and syntax location to check the output before copying or downloading formatted.json.

What this tool does and its limits

  • JSON comments, trailing commas, and JavaScript expressions are not standard JSON, so the tool reports them instead of silently changing their meaning.
  • Sorting changes object-key order. Leave it off when the original ordering is meaningful to a person or another system.

Clear and private

Readable JSON without a server round trip.

The browser parses and serializes your JSON locally. Invalid input produces a syntax message and location when the browser provides one.

Format or minify

Expand JSON for readability or remove unnecessary whitespace for compact transfer.

Recursive key sorting

Alphabetize keys inside nested objects while preserving the order of array items.

Safe output

Output is displayed as plain text and can be copied or downloaded only after successful validation.

Any JSON root

Objects, arrays, strings, numbers, booleans, and null are all valid JSON documents.

FAQ

Common questions

What does JSON formatting change?

Formatting changes whitespace and indentation, not the represented values. Enabling key sorting intentionally changes object-key order, which normally has no semantic meaning in JSON.

Does minifying JSON remove data?

No. It removes insignificant whitespace while retaining the parsed JSON values. The result may normalize number representation and escape sequences because it is serialized again.

Can duplicate object keys be detected?

Not reliably in this version. Standard JSON parsing keeps the last value for a repeated key, so avoid using duplicate keys when their distinction matters.

Is my JSON uploaded or stored?

No. Validation, formatting, sorting, and minification run locally in your browser. Got A Tool does not receive the JSON.

Keep working