JSON Formatter & Beautifier
Format and beautify JSON online for free. Instantly pretty-print JSON with syntax highlighting, error detection, and copy/download support.
Indent:
Frequently Asked Questions
What is a JSON formatter?▾
A JSON formatter (also called a JSON beautifier or pretty printer) takes compact or minified JSON and adds proper indentation and line breaks to make it human-readable. It helps developers quickly inspect API responses, configuration files, and data structures.
What is a sample JSON format?▾
A sample JSON looks like: { "name": "John", "age": 30, "email": "john@example.com", "hobbies": ["coding", "reading"], "address": { "city": "Mumbai", "country": "India" } }. JSON supports strings, numbers, booleans, arrays, objects, and null values.
Is my JSON data safe?▾
Yes, 100%. JSONDev.in processes all JSON entirely in your browser using JavaScript. No data is ever sent to any server. You can even use it offline once the page has loaded.
What indentation should I use for JSON?▾
2 spaces is the most common convention for JSON files (used by npm, most APIs, and JSON.stringify defaults). 4 spaces is used by some style guides. Tabs save bytes but are less portable. For minified production JSON, use 0 indentation.
Why is my JSON invalid?▾
Common JSON errors include: trailing commas after the last item in an object or array, single quotes instead of double quotes, unquoted keys, comments (JSON does not support comments), and missing or extra brackets/braces.
How do I format JSON in JavaScript?▾
Use JSON.stringify(data, null, 2) to format JSON with 2-space indentation. To parse a JSON string, use JSON.parse(jsonString). For example: const formatted = JSON.stringify(JSON.parse(rawJson), null, 2).