How to use the JSON Formatter
Paste JSON into the input editor. Select Beautify with two, three or four spaces, or tabs, to make nesting easier to follow. Choose Minify to remove unnecessary formatting whitespace, or Validate when you only need to check syntax. The size and key count give you a quick overview of the data.
If validation fails, use the reported line and column and the plain-English hint to investigate. Common problems include trailing commas, single-quoted strings, unquoted keys, comments, missing commas, undefined, NaN and capitalized True or False. Correct the input and try again, then copy the output or download a .json file. Formatting takes place in the browser, so payloads are not submitted to a remote parser.
Step-by-step guide
- Paste the JSON payload into the input editor.
- Choose an indentation style if you want a readable, beautified result.
- Select Beautify, Minify or Validate for the task at hand.
- If an error appears, inspect its line, column and hint, then correct the source.
- Review the output and size information, then copy it or download it as .json.
- Use Clear to remove the working content before starting another check.
Practical examples
Make a compact response readable
Start with {"name":"Mira","active":true,"roles":["editor","reviewer"]}. Beautify with two spaces separates the nested array and object structure into indented lines. The values stay the same, and name, active and roles remain in that order.
Remove a trailing comma
{"items":[1,2,]} is not valid JSON because the array has a comma after its last value. Remove that comma to get {"items":[1,2]}, then validate again. JavaScript accepting a similar expression does not make it valid JSON.
Keep a large identifier exact
In {"id":9007199254740993}, the numeric digits are preserved during formatting rather than rounded through JSON.parse. The receiving application must also handle large integers safely; exact formatting does not change that application's number limits.
Fix a JavaScript-style object
{enabled: True, note: 'ready'} uses an unquoted key, a capitalized boolean and single quotes. Valid JSON is {"enabled":true,"note":"ready"}. JSON requires double-quoted object keys and strings, and lowercase true, false and null.
Benefits
01
Trace nesting without changing data
Consistent indentation reveals arrays and objects while preserving key order and the exact representation of numbers.
02
Get a useful starting point for repairs
Line and column information narrows the search, while targeted hints explain common differences between JSON and JavaScript syntax.
03
Choose a readable or compact handoff
Beautify helps with review; Minify removes formatting overhead. Copy and .json download support either workflow without retyping the payload.
Common use cases
- Inspect a JSON response during API development.
- Find a syntax error in a configuration file.
- Prepare a readable payload for a code review.
- Minify JSON before placing it in a text field.
- Check data containing identifiers larger than JavaScript's safe integer range.
Frequently asked questions
Which indentation choices are supported?
Beautify supports two spaces, three spaces, four spaces or tabs. Indentation affects readability, not the meaning of valid JSON.
Will large integers be rounded?
The formatter preserves exact numbers instead of converting them through JSON.parse. For example, 9007199254740993 keeps those digits. A downstream application may still round that number if it uses an unsuitable numeric type.
Does formatting alphabetize the keys?
No. Original key order is retained. This makes it easier to compare the formatted output with a source payload or follow a producer's chosen grouping.
Can I use comments, undefined or NaN?
Not in standard JSON. Comments, undefined and NaN are invalid, as are single quotes and unquoted keys. Decide what the intended data should be before repairing it; replacing an invalid value with null can change its meaning.
Does Validate check my application schema?
Validate checks JSON syntax. It does not establish that required business fields exist, an email address is correct or values match an application-specific schema. Syntactically valid JSON can still be unsuitable for your API.
Is a sensitive payload sent to a server?
No. The editor, validation and formatting work locally in your browser. Output leaves the tool only when you choose to copy or download it.