JSON Formatter & Validator

Paste JSON to format, minify, sort, and validate it instantly.

How to use

  1. Enter the JSON to format.
  2. Choose indentation or minification and optionally sort object keys.
  3. Resolve any errors, then copy the result or save it as TXT.

Formatting options

Original text

0 characters

Not saved

Formatted JSON

0 characters

Waiting

About this tool

Format API responses, configuration files, structured data, and other JSON while checking syntax validity.

Valid syntax does not prove that the values are meaningful

“{"count":2}” is valid JSON and can be formatted. “{count:2}” is a syntax error because the property name is not quoted.

Try a use case and check the result

Format JSON for readability and check syntax and values that can be read without loss.

Try this example replaces the input and settings. Restore previous input returns to the state before the latest example. Normal draft-saving rules apply.

After trying multiple examples, repeat Restore previous input to return to your original input. History is kept only in this page; restore any input you need before closing it.

Format with two-space indentation

Input and settings

{"name":"A","count":2}

Sort keys: Off; Indentation: 2

Expected result

{
  "name": "A",
  "count": 2
}

See duplicate keys block formatting

Input and settings

{"a":1,"a":2}

Sort keys: Off; Indentation: 2

Expected result

An error is shown and formatted output remains empty, preventing one value in the same object from being silently lost.

How to read the result

Errors preserve the source input. Sorting object keys does not reorder arrays.

Scope and pitfalls

This is not schema validation. Duplicate keys and values that would change as JavaScript numbers block formatting. For example, 9007199254740993 is blocked because reading it as a JavaScript number would change its value. The source input remains available; check the source data specification before correcting it.

Continue with the next task

Frequently asked questions

Does it support comments in JSON?

No. It follows standard JSON, so comments and trailing commas are reported as errors.

Does sorting keys change array order?

No. Array order stays unchanged; only object keys inside arrays are sorted.

Is my JSON sent to a server?

No. Parsing and storage take place only in your browser.

Related tools

Inputs and storage

Keep a separate copy before clearing or resetting. This browser autosaves entered text and tool settings. Data is not restored when read 30 days or more after its last save. Clearing site data or storage restrictions may remove it sooner.

Favorites and language preferences are stored separately and may be lost when site data is cleared. Tool resets and site-data deletion do not delete files already downloaded to your device.

Explore tools & games

All 120 tools · 16 games

All 120 tools · 16 games

Text & writing 26

Calculators & converters 22

Date & time 12

Images & PDF 26

Data & web 28

Random & handy 6

Games 16