# JSON Formatter

URL: https://phishdestroy.io/developer-tools/json-formatter
Category: General dev
Where it runs: Runs locally (nothing you enter is uploaded)

Paste JSON, for example an RDAP or API response, and get it indented with 2 or 4 spaces, optionally with sorted keys. Invalid JSON shows the parser's error message and position.

## Example input

RDAP-style domain record

```
{"objectClassName":"domain","ldhName":"EXAMPLE.COM","status":["client delete prohibited","client transfer prohibited"],"events":[{"eventAction":"registration","eventDate":"1995-08-14T04:00:00Z"}]}
```

Prints the record with 2-space indentation, one key or array item per line; tick Sort keys to list events, ldhName, objectClassName and status alphabetically.

## FAQ

### What does the formatter check?

It parses the input with the browser's built-in JSON.parse, so anything that is not strict JSON is rejected with the parser's message and position. Valid input is printed with 2 or 4 spaces, with keys sorted at every level if you tick Sort keys, or on one line with Minify.

### Can formatting change my data?

Values go through JavaScript, so integers above 2^53 such as 64-bit IDs are rounded (12345678901234567890 prints as 12345678901234567000), and with duplicate keys only the last one is kept. Comments, trailing commas and single quotes are reported as errors, not fixed.

### Is the JSON uploaded?

No. Parsing and formatting run in your browser; nothing is sent or stored.

## Related tools

- [JSON Minifier](https://phishdestroy.io/developer-tools/json-minifier)
- [JSON Key Sorter](https://phishdestroy.io/developer-tools/json-key-sorter)
- [JSONPath Evaluator (Dot Notation)](https://phishdestroy.io/developer-tools/jsonpath-evaluator)
- [JSON Diff](https://phishdestroy.io/developer-tools/json-diff)
- [Abuse Contact Lookup](https://phishdestroy.io/developer-tools/abuse-contact-lookup)

All tools: https://phishdestroy.io/developer-tools
