Skip to content
Categories
JSON Formatter
Format JSON to make it easy to read.
Overview
- Takes JSON data that has been minified into a single line and adds indentation and line breaks to make it easy for humans to read.
- Widely used when developers need to visually inspect API responses or configuration files.
- A related format, JSON Lines (JSONL), lists independent JSON objects one per line, whereas this tool works on a single JSON document as a whole.
Usage
- Enter the JSON you want to format into the text area.
- Click the "Format" button.
- The result, indented with 2 spaces, is displayed below. Use the "Copy" button to copy it to the clipboard.
Example
Input
{"name":"Taro","age":20,"hobbies":["reading","coding"]}Output
{
"name": "Taro",
"age": 20,
"hobbies": [
"reading",
"coding"
]
}Use Cases
- Formatting a minified API response to understand its structure while debugging
- Improving readability of configuration files such as package.json or tsconfig.json before editing
- Formatting a JSON log line to quickly locate the field causing an error
FAQ
Is the JSON I enter sent anywhere?
No. Formatting happens entirely in your browser, and nothing is sent to an external server.
What happens if I enter invalid JSON?
An error message "The JSON format is invalid." is displayed. Check your syntax for issues such as extra or missing commas and unclosed quotes.
Can I change the indent width of the formatted result?
It is currently fixed at 2 spaces. Let us know if you need a different width.
Notes
- Formatting very large JSON data (several MB or more) may make browser processing slow.
- JSONC and JSON5, which allow comments or trailing commas, are not supported. Use input that conforms to the standard JSON specification.
- If an object contains duplicate keys, only the last occurring value is reflected in the result, per JavaScript's specification.
Related Tools
Validate whether JSON is correctly formatted.
Convert JSON into YAML format.
Convert a JSON array into CSV format.
Compare two JSON values regardless of key order and display the structural differences.