JSON Formatter
Make an API response readable while retaining the original numeric and string literals. This tool formats and minifies standard JSON.
Understand the input and result
{"id":9007199254740993,"name":"Mina","active":true}{
"id": 9007199254740993,
"name": "Mina",
"active": true
}Reading the result
The example id exceeds JavaScript's safe integer range. This formatter rearranges tokens without calculating numeric values, so 9007199254740993 remains intact. Array order and repeated keys also retain their original order.
Common mistakes
Single quotes, comments and trailing commas are not standard JSON. Use JSON5 Formatter for that syntax. Passing a syntax check does not validate an API's required fields or business rules.
Examples were checked against this tool's processing behavior. Review whether the meaning and format fit your own input.
How to use the JSON formatter
JSON is a data format often used in API responses and configuration files. A long, single-line document can make nested objects and arrays difficult to read. This tool adds indentation and line breaks to reveal the structure, or removes unnecessary whitespace for a compact form. Formatting does not reorder keys alphabetically.
How to use it
- Paste standard JSON into the editor and choose 2 or 4 spaces for indentation. A single-line example is {"name":"ToolSites","items":[1,2]}. When using an API response, copy only the response body and check that HTTP headers or a log prefix have not been included.
- Choose Format to read the structure, or Minify when you need a compact single-line form. Both actions check JSON syntax and leave invalid input unchanged. If an error position is available, inspect nearby quotes, commas and brackets, correct the input and try again. JSON5, comments and trailing commas must be converted to standard JSON first.
- Your input stays on the left and the transformed text appears on the right. Copy the result into code, documentation or a request body. Editing the input clears the previous result, so run the action again after making changes. Reset clears both panes while keeping the indentation choice. Before sharing, check for personal information, tokens or other sensitive values.
Why use this tool
Consistent indentation makes it easier to see which values belong to an object and which entries sit inside an array. It helps with inspecting a long response or explaining a data structure to someone else. Minify removes unnecessary whitespace rather than applying a data compression algorithm, allowing you to switch between readable and compact representations as needed.
Large integer literals, strings and key order stay as written while whitespace is changed. This avoids converting an identifier or large number into a different numeric value during formatting. Processing takes place in the browser without sending the input to a formatting server or saving it. Preserving a number here does not guarantee that another program will handle it precisely; check that program’s numeric range too.
Where it can help
Format an API response to inspect nested data such as user details, lists or error objects. Use the structure to find a field or compare a successful response with an error response. The tool does not make API calls or interpret what a response means, so you must paste the data yourself.
Check syntax after editing a configuration file or a working JSON document. Look for missing commas or mismatched brackets and apply consistent indentation. Syntactically valid JSON can still be missing required settings or contain a value of the wrong type. Check the target service’s schema and business rules separately.
Prepare examples for developer documentation, response data for a support question or a request body for a teammate. Use indentation for data that needs explanation and Minify for a single-line example. Copy does not anonymize data or remove sensitive values, so review information intended for sharing before sending it.
How it works and what to keep in mind
Paste JSON and choose Format or Minify. Select 2 or 4 spaces for indentation. Large integers, strings and key order stay unchanged. JSON5, comments and trailing commas are not supported. Input is not sent to a server or saved.
Use the header buttons to switch languages or light and dark modes instantly. Switching keeps your input, results and running state. Your language and theme choices also apply on later visits and when you navigate to another page.