JSON Formatter
Cmd/Ctrl+Enter saves this input to history.
Advertisement
Paste JSON, get it pretty-printed with 2-space indentation instantly. There's no upload step and no server round-trip — parsing and formatting both happen in your browser.
Most "invalid JSON" errors trace back to one of three things: a trailing comma after the last item in an object or array, single-quoted strings or unquoted keys (both valid JavaScript object-literal shorthand, neither valid JSON), or a stray NaN/undefined value. None of those are formatter bugs — they're the JSON spec being stricter than JavaScript.
Frequently asked questions
- Is this JSON formatter free to use?
- Yes. It runs entirely in your browser — no signup, no rate limit, no data sent to a server.
- Why does it say my JSON is invalid?
- The three most common causes: a trailing comma after the last item, single-quoted strings or unquoted keys, or a NaN/undefined value. All four are valid JavaScript but not valid JSON.
- Does formatting change my actual data?
- No — it only re-indents. One exception: if your JSON has duplicate keys, the formatted output keeps only the last one, because parsing happens before formatting and duplicate keys are resolved at parse time, not a side effect of formatting.
- Is my JSON uploaded anywhere?
- No. Parsing and formatting happen locally in your browser tab — nothing is sent to a server.
Read the full guide for this tool →
Related tools & guides
Part of JSON Tools: Format, Validate, Diff, Convert, and Generate Types
Tools
Guides
- Semantic JSON Diff vs Text Diff: Key Order, Array Order, and Type Coercion
- Converting CSV to JSON: Where It Actually Goes Wrong
- Generating Mock JSON Data From a Schema — Seeds, Determinism, and What Gets Faked
- JSON Formatting and Validation: What Actually Trips People Up
- What "Required" Means When You Infer a JSON Schema From Samples
- JSON Schema vs Zod: They Solve Different Halves of the Same Problem
- quicktype vs Live Types: Different Jobs, Not Direct Competitors
- "Unexpected Token in JSON at Position 0" — What It Actually Means
- XML to JSON Conversion: Attributes, Mixed Text, and Why Repeated Tags Become Arrays
- Fixing Double-Encoded JSON Strings (JSON.stringify Twice)
- Detecting Breaking Changes in a JSON API Response
- JSON vs YAML for Config Files
Advertisement