Developer tools

JSON Formatter

Turn a compact API response into readable JSON, or remove indentation for a smaller text payload. Check syntax before copying the result into your request, configuration or test fixture.

Your workspaceProcessed in your browser

Accepts strict JSON: double-quoted keys and strings, without comments or trailing commas. Formatting changes only whitespace outside strings. Original number digits, exponent notation, string escapes, key order, and duplicate keys are preserved. Other JSON parsers may interpret duplicate keys differently. Limits: 2 MiB UTF-8 input, 128 nesting levels, and 8 MiB formatted output.

Processed in your browser. Your text is not uploaded.

How to use it

  1. Paste a JSON value, object or array into the input.
  2. Choose readable formatting or minification and run the action.
  3. If an error appears, check the reported syntax or size limit before trying again and copying the result.

A few useful details

Readable structure

Indent nested objects and arrays so it is easier to follow keys, values and bracket pairs.

Strict syntax checks

Find mistakes such as a trailing comma, a missing quote or an unclosed bracket before using the data elsewhere.

Compact output

Remove unnecessary formatting whitespace while keeping whitespace inside string values.

Questions, answered.

Why is a JavaScript object rejected?

JSON is stricter than JavaScript. Property names and strings need double quotes. Comments, trailing commas, undefined, NaN, functions and single-quoted strings are not valid JSON.

Does valid JSON mean my API request is correct?

No. Syntax validation checks the JSON structure. Your API can still reject a missing field, the wrong type or an unsupported value. This tool does not validate a JSON Schema or your application’s rules.

What should I do with very large numeric IDs?

This formatter preserves the original numeric text rather than rewriting parsed numbers. Other JavaScript-based software may round integers beyond 9,007,199,254,740,991. When you control the data format, quoted strings are a useful choice for long identifiers; check that downstream software agrees.

Does the formatter execute pasted code?

No. JSON is treated as data, not executed as JavaScript. Formatting does not make data safe to insert into HTML or SQL; those destinations still require their own handling.