JSON formatting (prettifying) adds indentation and line breaks to make compact JSON human-readable. Minifying removes all whitespace to reduce file size for production use.
The tool parses your input using JSON.parse(). If it throws an error, the JSON is invalid. The error message and position help you locate the exact problem.
Common errors include: missing quotes around keys, trailing commas after the last item, single quotes instead of double quotes, and unescaped special characters in strings.
JSON requires double-quoted string keys and does not support functions, undefined, or comments. JavaScript objects are more flexible. JSON.parse() and JSON.stringify() convert between them.
No. The JSON specification does not allow comments. If you need comments, use JSONC (JSON with Comments) format supported by VS Code and TypeScript configs, or strip comments before parsing with a library.
JSON supports null (appears as the literal value null), but undefined is not a valid JSON value β it is a JavaScript concept. Properties with undefined values are omitted by JSON.stringify(). Use null explicitly when you need to represent a missing value in JSON.
JSON5 is a superset of JSON that allows comments, trailing commas, single-quoted strings, and unquoted keys. It is human-friendlier but requires a JSON5 parser β standard JSON.parse() will reject it. This tool handles standard JSON only.
JSON is the universal data format for APIs, configuration files, and databases. This tool formats messy, minified, or malformed JSON into readable form, validates syntax with precise error messages, and minifies JSON back for production use.
Paste your JSON
Paste any JSON β minified API response, log output, config file, or manually written data β into the input field. Formatting and validation happen automatically.
Read the validation result
If the JSON is valid, the formatted output appears immediately. If it is invalid, an error message shows the exact line and position of the problem to help you fix it fast.
Format or minify
Use 'Format' to expand JSON with 2-space indentation for readability. Use 'Minify' to strip all whitespace for embedding in production code or network payloads.
Copy the result
Copy the formatted or minified JSON with one click, ready to paste into your editor, terminal, or API client.
Read API responses
REST APIs often return minified JSON in a single line. Paste it here to instantly expand it into a human-readable tree structure, making it easy to find the field you need.
Debug JSON configuration files
Config files for tools like ESLint, TypeScript, Webpack, and Docker Compose must be valid JSON. Paste your config here to find syntax errors β missing commas, trailing commas, or mismatched brackets β before they cause build failures.
Prepare data for production
Before embedding a JSON payload in code or sending it in a network request, minify it to reduce payload size and remove unnecessary whitespace that wastes bandwidth.
JSON (JavaScript Object Notation) is the dominant data interchange format for web APIs, configuration files, and structured storage. Minified JSON removes all whitespace to reduce payload size; formatted (pretty-printed) JSON adds indentation and newlines to make nested structures human-readable. When a JSON document is malformed β a missing comma, an unquoted key, a trailing comma after the last element β a clear error with the affected line number makes debugging significantly faster.
This formatter accepts raw JSON from any source β API responses, log files, configuration files, database exports β and renders it indented with 2-space indentation. The validator highlights syntax errors with the line number so you can locate and fix problems immediately. The minifier strips all whitespace, which is useful before embedding JSON in an environment with size constraints or before comparing two documents whose only differences might be formatting.