Developer
JSON Formatter & Validator Online
Format and validate JSON instantly in your browser, no sign-up, nothing uploaded. Paste your JSON to beautify it with 2-space, 4-space, or tab indentation, minify it to a single line, or see a precise error with line and column number. Also converts to YAML, CSV, and XML, sorts keys alphabetically, and escapes or unescapes JSON strings.
Output appears here as you type…100% private, all processing runs in your browser. Your JSON is never uploaded or stored.
What each mode does
Beautify
Re-formats JSON with readable indentation. Choose 2 spaces (default), 4 spaces, or a tab character. Best for reading API responses or editing config files.
Minify
Strips all whitespace and newlines. Produces the smallest valid JSON string, use for production API payloads, cookies, or local storage values.
YAML
Converts JSON to YAML format. Useful when moving config between JSON-based tools (package.json, tsconfig) and YAML-based tools (GitHub Actions, Docker Compose).
CSV
Converts a JSON array of objects to comma-separated values. Each object becomes a row; keys become column headers. Ready to open in Excel or Google Sheets.
XML
Converts JSON to a well-formed XML document. Useful when integrating with SOAP services or XML-based systems that consume structured data.
Escape / Unescape
Escape turns any raw text into a safe JSON string value (quotes, backslashes, and control characters are encoded). Unescape decodes it back. Handy when embedding code or HTML inside a JSON field.
Sort keys
Reorders all keys inside every object alphabetically (A→Z or Z→A), recursively through the entire tree. Useful for diffing configs or normalising output.
Understanding JSON validation errors
The most common JSON syntax mistakes and how this tool pinpoints them:
Trailing comma
{"a": 1,}JSON does not allow a comma after the last item in an object or array. Remove the comma before } or ].
Single-quoted strings
{"key": 'value'}JSON requires double quotes (") for all string values and keys. Replace single quotes with double quotes.
Unquoted keys
{key: "value"}Unlike JavaScript objects, JSON requires keys to be double-quoted strings: {"key": "value"}.
Comments in JSON
{"a": 1 // comment}Standard JSON (RFC 8259) does not support comments. Remove them, or switch to JSON5 / JSONC if your parser supports it.
Undefined or NaN values
{"x": undefined}JSON has no undefined, NaN, or Infinity. Replace with null or a valid number string.