Format JSON Online — Free, Private, Instant
Paste minified or messy JSON below and get a clean, indented version instantly. Runs entirely in your browser — your data never leaves your device.
JSON 校验
What is JSON formatting?
JSON formatting (also called pretty-printing or beautifying) rewrites a JSON document with consistent indentation, line breaks, and spacing so it is readable by humans. The data itself does not change — only the whitespace. Minified JSON like {"name":"Ada","skills":["math","logic"]} becomes:
{
"name": "Ada",
"skills": ["math", "logic"]
}When do you need to format JSON?
- Reading API responses — most APIs return minified JSON to save bandwidth, but it's unreadable until formatted.
- Debugging configuration files — a 200-line JSON config dumped on one line is impossible to scan for the field you need.
- Comparing two payloads — formatted JSON diffs cleanly in git or any diff tool.
- Code reviews and documentation — example payloads pasted in docs should be indented for readability.
- Spotting structural bugs — formatted JSON makes missing commas, mismatched brackets, and extra trailing data visible at a glance.
How to format JSON with JSON Shuttle
- Paste your JSON into the input box at the top of this page.
- Click “Beautify”. JSON Shuttle parses your input and re-emits it with 2-space indentation.
- Copy the result from the output area. The formatted version is valid RFC 8259 JSON, byte-for-byte equivalent in meaning to your input.
If your JSON has syntax errors, the formatter will show the line and column of the first error. Use the repair mode to auto-fix common issues like trailing commas or unquoted keys first.
Common JSON formatting issues
- “Unexpected token '}' at position X”
- Usually means a trailing comma after the last item in an object or array. JSON (unlike JavaScript) does not allow trailing commas.
- “Unexpected token N in JSON”
- Often a key without quotes, like
{name: "Ada"}. JSON requires keys to be double-quoted strings. - Single quotes
- JSON spec only allows double quotes. Single-quoted strings are valid JavaScript but invalid JSON.
- Comments
- JSON does not support
//or/* */comments. Strip them before formatting, or use JSON Shuttle's repair mode.
Frequently Asked Questions
- Is the JSON formatter free?
- Yes. JSON Shuttle's formatter is completely free with no signup or ads. The entire tool runs in your browser.
- Does the formatter send my JSON to a server?
- No. Formatting happens entirely client-side. Your JSON is processed by JavaScript running in your browser and never sent to any server. This makes JSON Shuttle suitable for sensitive data like API responses with PII or internal configuration.
- What indentation does the formatter use?
- JSON Shuttle defaults to 2-space indentation, which is the most common style in JavaScript and Python ecosystems. Output is RFC 8259-compliant standard JSON.
- Can the formatter handle large JSON files?
- For best performance, keep input under ~5 MB. Modern browsers can handle larger but the UI may slow down. For multi-gigabyte JSON, consider streaming tools like jq instead.
- Does it work offline?
- Yes. After the page loads once, you can disconnect and the formatter still works. Bookmark the page for offline use.
Related JSON tools
- JSON Validator — check if your JSON is well-formed
- JSON Repair — auto-fix common syntax errors
- JSON Escape / Unescape — escape strings for embedding inside other JSON
- About JSON Shuttle — privacy, use cases, full FAQ