ruxox
Start
Start
JSON

JSON Formatter

Format, minify, and validate JSON in your browser. Pretty-print API responses and configuration payloads instantly. No server, no data sent.

JSON Formatter

Runs entirely in your browser — no server calls, no tracking.

Paste JSON and click Format.

🔒 Your data never leaves this tab. This tool has no backend.

About this tool

About the JSON Formatter

A JSON formatter takes raw JSON — often received as a single-line API response or a minified config — and renders it with consistent indentation so you can read it at a glance. This tool also validates the input: if the JSON is malformed it shows the exact parse error rather than silently producing no output.

When to use pretty vs minify

Use pretty print when debugging API responses, reviewing webhook payloads, or reading configuration files. Two-space indent is the JavaScript convention; four-space matches Python's default json.dumps(indent=4). Use minify when pasting into a <script> tag or a database column where you want compact storage without whitespace overhead.

Common JSON issues

Trailing commas ([1, 2,]) are not valid JSON — they are valid in JS object literals and JSONC but not in JSON spec. Single-quoted strings fail too; JSON requires double quotes. undefined, NaN, and Infinity are not valid JSON values — they will silently serialize to null in JSON.stringify. This formatter catches all of these at parse time.

For large API responses, minifying before storing in logs reduces storage costs significantly. A 10KB pretty-printed response is often 6–7KB minified. At scale — millions of log entries — that difference is measurable.

FAQ

Frequently asked questions

What is the difference between JSON and JavaScript object literals?
JSON is a strict data serialization format: keys must be double-quoted strings, values must be one of string, number, boolean, null, array, or object. JavaScript object literals allow unquoted keys, trailing commas, comments, and values like undefined or Infinity. This formatter validates against the strict JSON spec, not JS syntax.
Why does my JSON show "Invalid JSON" even though it looks correct?
Common causes: trailing comma after the last property or array element, single-quoted strings instead of double-quoted, a comment left in the file (JSON has no comment syntax), or a BOM character at the start of a file copied from Windows. The error message in the output will point to the exact line and column.
Can I format nested JSON embedded in a string?
Not directly — if the JSON is inside a string value (escaped quotes), you would need to extract it first. Paste just the inner JSON payload, format it, then re-embed it. For deeply nested string-encoded JSON, consider a code editor with an inline JSON formatter extension.
Is there a size limit for the JSON I can paste?
No server limit — processing happens entirely in your browser. In practice, JSON over a few megabytes will slow down the browser UI. For very large files, a local tool or command-line jq is faster.
Custom software

Need custom APIs or data pipelines built?

ruxox builds production-grade web apps, APIs, and automation tools. Free scoping estimate in 48 hours.