JSON Formatter & Validator
Paste JSON to pretty print, minify, or validate. Everything runs in your browser.
What Is JSON?
JSON (JavaScript Object Notation) is a lightweight data format used to exchange data between servers and web applications. It is human-readable and machine-parseable. JSON uses key-value pairs inside curly braces for objects and square brackets for arrays. It has become the standard data format for APIs, configuration files, and data storage across virtually all programming languages.
Common JSON Errors
Trailing commas: JSON does not allow a comma after the last item in an object or array. This is the most common error when copying from JavaScript code. Single quotes: JSON requires double quotes around strings. Single quotes are not valid. Unquoted keys: Unlike JavaScript objects, JSON keys must be wrapped in double quotes. Comments: JSON does not support comments. Remove any // or /* */ comments. Missing commas: Every key-value pair except the last must be followed by a comma.
JSON Formatter FAQ
Is my JSON data sent to a server?
No. This tool runs entirely in your browser using JavaScript. Your JSON data never leaves your device. Nothing is transmitted, stored, or logged.
What is the difference between JSON and a JavaScript object?
JSON is a strict subset of JavaScript object syntax. Key differences: JSON requires double quotes around all keys and string values, does not allow trailing commas, does not support comments, and does not allow functions or undefined values. A JavaScript object is more flexible but cannot be directly transmitted over a network without conversion to JSON.
What does minify do?
Minifying removes all whitespace, line breaks, and indentation from JSON. This reduces the file size, which is useful when sending data over a network. The data itself is unchanged. Formatting (pretty printing) is the reverse: it adds indentation and line breaks to make the JSON readable.