How to Use
Paste your JSON into the text area. Click Format to pretty-print it with 2-space indentation, Minify to compress it to one line, or Sort Keys to alphabetically sort all object keys at every level. If your JSON has an error, the status bar shows the error message and location.
All Processing Is Local
JSON formatting uses your browser's built-in JSON.parse() and JSON.stringify() functions. No data leaves your browser. This is safe for use with sensitive API keys, tokens, or private data.
Frequently Asked Questions
JSON (JavaScript Object Notation) is a lightweight data format used to store and transmit structured data. It consists of key-value pairs in curly braces for objects, and ordered lists in square brackets for arrays. JSON is the most common format for API responses and configuration files.
Pretty printing adds indentation and line breaks to make JSON human-readable. Minifying removes all unnecessary whitespace to reduce file size for transmission. This tool formats JSON with 2-space indentation by default.
Common JSON errors include trailing commas (not allowed in JSON, unlike JavaScript), single quotes instead of double quotes around strings, missing commas between elements, unclosed brackets or braces, and undefined or NaN values (which are not valid JSON). This formatter shows the line and character position of any error.
JSON is a strict subset of JavaScript object notation. JSON requires double quotes for all keys and string values, does not allow trailing commas, does not allow comments, and does not support special values like undefined, NaN, or Infinity. JavaScript objects are more flexible and are not directly interchangeable with JSON.
No. All JSON formatting, validation, and minification is performed entirely in your browser using JavaScript. Your data is never sent to any server or stored anywhere.
Related Calculators
More tools in the Developer Tools category.