Paste any JSON to instantly pretty print, minify, or validate it with this free online JSON formatter. Syntax errors are detected and displayed with exact line and column numbers so you can fix issues fast. Features include customizable indentation (2 spaces, 4 spaces, or tabs), alphabetical key sorting, full syntax highlighting with color-coded tokens, and real-time JSON statistics showing size, key count, array count, and nesting depth. All formatting happens entirely in your browser — no data is sent to any server. Works offline, no signup required.
{"key": "value"} and ordered arrays [1, 2, 3]. JSON supports six data types: string, number, boolean, null, object, and array. It's the dominant data format for REST APIs, configuration files, and database storage.
'name' → "name"{"a": 1,} is invalid. Remove the comma after the last item.{name: "John"} is JavaScript, not JSON. Keys must be quoted.// or /* */.const obj = JSON.parse(jsonString); — and serialize with JSON.stringify(obj, null, 2)import json; obj = json.loads(json_string) — serialize: json.dumps(obj, indent=2)import "encoding/json"; json.Unmarshal([]byte(jsonString), &obj)$obj = json_decode($jsonString, true);
JSON.parse() and JSON.stringify() APIs. No data is ever sent to a server. The tool works fully offline. We strongly recommend not pasting production secrets or API keys into any online tool — as a general security practice.