Financial CalculatorsDate & Time CalculatorsHealth CalculatorsMath CalculatorsLength ConvertersWeight ConvertersTemperature ConvertersArea ConvertersVolume ConvertersSpeed ConvertersData & File Size ConvertersDigital & Data ToolsText ToolsGeneratorsImage & Video Tools About Practical guides Contact
Processed locally in your browser

JSON Formatter

Format, inspect, and compare JSON while preserving the exact text of large numeric IDs.

{ }
Your JSON, made clear.Format, validate, and explore. Your JSON is processed in this browser.
0 characters · 1 line
JSON only · Up to 1 MiB Ctrl / ⌘ + Enter to run
Ready when you are
Explore your data
{ }A little structure goes a long way.

Paste JSON to explore objects, arrays, and values.
Or load the example to see how it works.

$

Compare two JSON documents

See exactly which values changed before sharing an API response or configuration. Numeric tokens stay intact, including large IDs. Follow the seven-change walkthrough.

Compare two documents to see changes.

Comparison rules and limits

Object property order and equivalent string escapes are ignored. Arrays are compared by position; moves are not inferred. Number text is compared exactly, so 1, 1.0, and 1e0 differ. Duplicate property names must be resolved first. Missing and null are different. Paths use JSON Pointer; (root) means the whole document.

Each input is limited to 1 MiB of UTF-8, 50,000 values, and 100 nesting levels. At most 500 differences are returned; a partial report is clearly marked. Downloads contain compared values and are descriptive reports, not executable JSON Patch files. Processing stays in this browser.

Choose the right JSON action

Format adds indentation and line breaks. Minify removes optional whitespace outside strings. Validate checks syntax. Both formatting actions validate first, so broken input cannot produce a misleading export. Switch to Tree to inspect nested data, or Code to review the exact text you will copy.

Formatting examples with expected output

Readable API response. Input: {"order":1042,"paid":true,"items":["book","pen"]}. With 2-space indentation, the output is:

{
  "order": 1042,
  "paid": true,
  "items": [
    "book",
    "pen"
  ]
}

The items remain in their original order.

Minify without changing a message. Input { "message": "hello world", "count": 2 } becomes {"message":"hello world","count":2}. The three spaces inside the string remain.
Keep a large identifier intact. Input {"id":9007199254740993} keeps the same digits after formatting and export.

How to Use This Tool

  1. Paste JSON, use Try an example, or open a UTF-8 JSON file.
  2. Choose 2 spaces, 4 spaces, or tabs. Auto-update checks changes after a short pause.
  3. Use Format JSON or Minify; Ctrl or Command + Enter also runs formatting.
  4. In Tree, open an object or array and select a property to copy its value. In Code, inspect the formatted output.
  5. Copy JSON or Download exports the entire current result. Editing the input clears an outdated result.

Common Use Cases

Inspecting nested API responses
Reviewing configuration changes
Preparing readable examples for documentation
Reducing whitespace in valid JSON

What stays unchanged

Formatting keeps the original property order, string escapes, and number text. For example, 9007199254740993, 1e400, and -0 are not rounded or converted to JavaScript numbers. This does not guarantee that the next app you paste into can represent those numbers exactly.

Editor limits and privacy

Parsing and file reading happen in your browser; this tool does not send JSON to ToolSprouts. Each document may contain up to 1,048,576 UTF-8 bytes (1 MiB), 50,000 values, and 100 nesting levels. For more than 2,000 values, open branches individually; children appear in groups of 100. An editor-limit message describes a size limit, not invalid JSON.

When formatting cannot help

Comments, single-quoted strings, and trailing commas are not accepted. Use the error location to repair the input or see the correction examples in the JSON validator. A duplicate-property notice means the document has repeated names: they stay in the output, but another application may discard earlier values. Rename or remove the duplicates before exchanging the data.

Related Tools

Practical walkthroughs

Frequently Asked Questions

Does formatting sort keys or change numbers?

No. Original key order and number text are preserved. Indentation changes whitespace outside strings only.

Why is Expand all unavailable?

It is disabled for documents with more than 2,000 values to keep the tree responsive. Open individual branches to inspect the document.

Is this a JSON Schema validator?

No. It checks JSON syntax, not required fields, allowed values, or the data types expected by your API.

Sources & References

See how we test and maintain our tools. Found a problem? Report the inputs and expected result.