FREE BROWSER-LOCAL FILE TOOLS

Format JSON into readable structure.

Open or paste JSON, inspect its structure, edit, format or minify it. Your contents stay in this browser.

Step 1: open your file

Start with a complete JSON value. Contents stay in this browser.

  1. Use Format for readable JSON or Minify for compact JSON; review the source.
  2. Download the formatted JSON.
Paste JSON

File contents stay in this browser. Download changes before refreshing or closing the tab.

Inspect nested structure

Searchable tree and raw editor views make nested objects, arrays, keys, values, and record boundaries easier to inspect.

Edit, format and validate

Pretty-print dense JSON or minify formatted JSON after the syntax passes validation. Syntax problems are reported without sending the document to a server.

Choose the matching format

Use JSON for one complete value, JSONL or NDJSON for one JSON value per line.

Other ways to format JSON

Run these alternatives on your own computer. Keep the original file and write changes to a separate output. These tools have their own parsing and precision rules; their output need not match this website exactly.

Pretty-print and minify with Python

Creates a readable formatted.json and a compact minified.json from the same input.

Before you start

  • Install Python 3. Save the script beside your UTF-8 input file and run it with python3 script.py. No extra package is required.
Python script
import json
from pathlib import Path

data = json.loads(Path("input.json").read_text(encoding="utf-8"))
Path("formatted.json").write_text(json.dumps(data, indent=2, ensure_ascii=False, allow_nan=False) + "\n", encoding="utf-8")
Path("minified.json").write_text(json.dumps(data, separators=(",", ":"), ensure_ascii=False, allow_nan=False) + "\n", encoding="utf-8")

Limits and output

  • These examples parse the document into memory. Python integers are exact. Unless a script explicitly uses Decimal, decimals use binary floating point; reserialization can change numeric spelling or precision. Duplicate object keys keep their last value unless explicitly rejected.

Documentation: Python JSON documentation

Format or minify with jq

Writes readable or compact JSON to a separate file.

Before you start

  • Install jq using its official installation guide. These commands use a POSIX shell; put the named input files in the current directory.
Terminal commands
jq '.' input.json > formatted.json
jq -c '.' input.json > minified.json

Limits and output

  • jq parses JSON rather than preserving source text. Numeric precision depends on the jq build and operations; keep exact source files for precision-sensitive data.

Documentation: jq manual and installation

Frequently asked questions

Can I convert JSONC comments to strict JSON?

In the browser editor, open a .jsonc file or paste JSONC source, then choose Repair and JSONC to strict JSON. Safe JSON repairs remains the default task. Review the complete original and converted result before downloading a separate .json copy or explicitly applying one undoable edit. Only comments and trailing commas are removed; numeric and string tokens remain unchanged. Ordinary formatting still requires strict JSON. Duplicate keys and JSON5 syntax are refused. Conversion supports up to 2 Mi characters, 128 container levels and 100,000 tokens/values, with local cancellation and a five-second limit. Native file associations, installed versions and integration support can differ.

Can I convert JSON5 to strict JSON without rounding numbers?

Choose Repair and JSON5 to strict JSON in the browser editor. Review the complete original and proposal, then download a separate .json copy or explicitly Apply; Undo restores the original. Supported JSON5 data includes comments, trailing commas, unquoted keys, single-quoted strings, signed decimals and hexadecimal integers. Strict decimal number spellings are retained, including values beyond JavaScript number range; hexadecimal integers convert exactly. Strings and keys are quoted or escaped when required. NaN, Infinity, decoded duplicate keys, JavaScript expressions and unsupported syntax are refused. Limits are 2 Mi source/output characters, 10,000 characters per numeric token, 100,000 tokens/values and 128 container levels, with local cancellation and a five-second deadline. Ordinary formatting and the separate JSONC task retain their strict policies. This does not provide comment-preserving JSON5 structured editing or certify installed/integration versions.

How do I format or minify JSON?

Open or paste a complete JSON value. Choose Format for readable indentation or Minify for compact JSON, review the source, then download the result.

Will the formatter accept invalid JSON?

No. Fix syntax errors before formatting or minifying. The source stays available in the editor while you correct it.

Does my JSON file get uploaded?

Local editing processes selected and pasted contents in your browser. Optional Assistance sends your goal and only the context you explicitly prepare and include, such as a selected subtree or observed query field metadata, to OpenRouter and the configured model provider. Its preview shows exactly what is included. Ordinary page and asset requests also reach the hosting provider.