‹ Back to Software

JSON Formatter

Format, minify, validate, sort, and explore JSON.

Input

Indent

Formatted JSON

{
  "hello": "world",
  "items": [
    1,
    2,
    3
  ]
}

Tree

root (2 entries)
  • hello: "world"
  • items (3 entries)
    • 0: 1
    • 1: 2
    • 2: 3

What JSON Formatter does

Format, minify, validate, sort, and explore JSON.

How to use it

  1. Paste JSON and choose indent size, tabs, or minify.
  2. Optionally sort keys. Parse errors show the line and column.
  3. Expand the tree with keyboard-accessible disclosure controls, then copy or save formatted.json.

Formats and limits

  • JSON text up to 2 MB; output is copied or saved as formatted.json. Errors include line and column.

Examples and checks

Compare two versions of a configuration

Paste {"b":2,"a":1} and enable Sort keys to place a before b. Use the same indent option and sorting choice for both files before comparing them in Text Diff. Sorting object keys reduces distracting order changes; it does not sort arrays, because array order can be part of the data.

Minify removes formatting space when you need compact output. It does not encrypt data or validate it against an application schema. JSON requires quoted property names and does not accept comments or trailing commas here. Use the error location to find a syntax problem, then inspect the parsed tree and saved output. Formatting can change number representations, so avoid treating it as a byte-preserving edit for signed data or unusually large numeric identifiers.

Privacy

Processing stays in this tab. Input and generated content are not uploaded or stored.

Related tools

All processing runs locally in your browser. This tool is provided as-is without warranty. Keep backups of your original files before processing.

By selecting media, you confirm you own the content or have permission to modify it. Please read the Terms and Conditions.