JSON Formatter
Format, minify, and validate JSON. Shows the exact line of any error.
Runs in your browser. Nothing is uploaded.
Waiting for JSON
Formatted JSON appears here.What this does
Paste JSON or drop a file. You get it back indented and readable, or squeezed onto one line for sending over the wire. If the JSON is broken, the status line tells you the line and column.
Is my data uploaded?
No. Formatting happens in your browser with the built-in JSON parser. Nothing is sent anywhere, so it is safe for API keys and customer data.
Sort keys
Turn on Sort keys to order every object alphabetically. Two responses formatted this way can be compared line by line.
Which indentation should I pick?
Use whatever your project already uses. 2 spaces is the most common choice for JavaScript and web projects, 4 spaces is common in Python and Java codebases, and Tabs suits teams that let each person set their own width. Minify removes every space and line break, which makes the file smallest for sending or storing. The download button saves the output as formatted.json or minified.json.
Why is my JSON invalid?
JSON is stricter than JavaScript. Keys and strings need double quotes, the last item in a list or object cannot have a comma after it, and comments, undefined and NaN are not allowed. The status line under the input shows the line and column where reading stopped; the real mistake is often just before that point, such as a missing comma at the end of the previous line.
Can formatting change my data?
Values stay the same in almost every case, with two things to know. If an object has the same key twice, only the last one is kept. Whole numbers larger than 9,007,199,254,740,991, such as some 64-bit IDs, are rounded by the browser's JSON reader, so check long numeric IDs in the output or keep them as strings.
Related tools
All json tools- JSON Viewer & Path FinderExplore JSON as a tree or a graph. Click any value to copy its path in JS, jq, JSONPath, or Python.
- JSON Diff & CompareCompare two JSON documents and see every added, removed, and changed value in one view.
- Base64 Encode & DecodeEncode text or files to Base64 and decode it back. Base64 to image preview, URL-safe option.
- JSON to CSV ConverterTurn a JSON array into CSV for Excel or Google Sheets. Nested objects flattened, table preview.
- CSV to JSON ConverterTurn CSV or TSV into a JSON array of objects. Numbers and booleans detected, dotted columns nested.
- JSON to TypeScriptTurn any JSON into TypeScript interfaces. Nested types named, optional keys detected.
- JSON to Go StructGenerate Go structs with json tags from any JSON. Nested structs named, pointers for nullable values.
- JSON to Kotlin Data ClassGenerate Kotlin data classes from JSON, for kotlinx.serialization, Gson, or plain Kotlin.