Format JSON
Format a compact or poorly indented JSON into a readable document, with 2-space indentation, directly in your browser.
Processed on your device. Nothing is sent to any server.
Parses the JSON with the browser's native parser and re-serializes it with indentation, showing a clear message with the exact line and column if the JSON isn't valid.
Use cases
- Formatting an API response to read it comfortably.
- Debugging a JSON configuration file.
- Preparing a readable JSON for documentation.
How it works
- 1
Paste your JSON
Type or paste the JSON into the input box.
- 2
Format it
Click Format and copy or download the result.
Technical details
- Indentation is always 2 spaces. It follows strict standard JSON: comments, trailing commas and single quotes aren't allowed.
- Integers longer than 15-16 digits (for example, 64-bit IDs) lose precision when processed: 12345678901234567890 becomes 12345678901234567000. If your JSON contains them, keep them as strings.
- If a key appears twice in the same object, only the last value is kept, without warning.
- Key order is kept, except for keys that are integers ("1", "42"), which the browser places first in ascending order.
Frequently asked questions
What happens if the JSON isn't valid?
An error message is shown indicating the approximate line and column where the problem is, instead of failing with no explanation.