JSON Formatter
This free JSON formatter cleans up messy JSON in your browser. Paste it in and the tool indents, validates, and highlights it, pointing to the exact line and column of any syntax error. Choose two spaces, four spaces, tabs, or minify, sort the keys, then copy or download. Nothing you paste is uploaded.
{
"name": "AEON Toolhub",
"tools": 25,
"free": true,
"categories": [
"productivity",
"text",
"developer"
],
"owner": {
"handle": "oiurireis"
}
}What does this JSON formatter do?
Paste messy or minified JSON and it comes back indented, colour-highlighted, and validated. This free JSON formatter from ÆON Toolhub runs entirely in your browser, so an API response with a token in it never leaves your machine. Pick two spaces, four spaces, tabs, or minify to a single line, sort the keys alphabetically, then copy the result or download it as a .json file.
If the JSON is broken, it does not just say "invalid": it tells you the line and column and shows the offending line with a caret under the exact character.
How do you use it?
Paste your JSON into the input box. Formatting happens as you type, with no button to press.
Pick the indentation. Two spaces is the common default, four spaces suits some codebases, tabs matches editors configured that way, and Minify strips everything to one line.
Sort the keys if you need to. Useful before diffing two files.
Fix any error. The message shows exactly where parsing stopped.
Copy or download. Take the result to your editor, or save it as a file.
How do you find the error in broken JSON?
Browsers report a character offset, something like position 412. That is almost useless in a 400-line file, which is why this tool converts it into a line and column, prints that line, and marks the exact character with a caret.
The usual culprits, in order of how often they show up:
- A trailing comma after the last item in an object or array.
- Single quotes instead of double quotes.
- Unquoted keys, which JavaScript allows but JSON does not.
- Comments, which strict JSON has no concept of.
- A missing or extra bracket, usually after a copy and paste.
JavaScript object syntax is more relaxed than JSON, so text lifted straight out of code often needs these small corrections first.
What do the statistics tell you?
Under the output you get the final size, the number of keys, and the nesting depth of the structure. Depth is the one people underestimate: deeply nested payloads are harder to consume, and a depth above five or six is usually a sign the shape could be flattened. When you switch to Minify, the tool also shows the percentage saved, which is typically 15% to 30% for a file that was indented.
Is formatting the same as changing the data?
No. Formatting only changes whitespace: indentation and line breaks. The keys, values, types, and array order are untouched, so the parsed result is identical before and after. Sorting keys is the one option that rewrites structure, and even then only the order of object keys changes, never the values, and never the order of arrays, which is meaningful data.
Your JSON stays private
The formatter runs entirely in your browser with the same JSON engine your code uses. What you paste is never uploaded, logged, or stored, and it clears when you close the tab. That makes it safe for API responses, config files, and anything containing keys or tokens, and it keeps working offline once the page has loaded.
Frequently asked questions
What does formatting JSON do?
Formatting, or beautifying, takes JSON that is minified or messy and rewrites it with consistent indentation and line breaks so it is easy to read. It does not change the data at all, only the spacing. This tool can also do the reverse, minifying JSON to a single line to save space.
How does it validate my JSON?
As you paste, the tool parses your text with the same JSON engine your browser uses. If anything is wrong, a missing comma, an extra bracket, an unquoted key, it shows the error message and points to the position where parsing failed, so you can jump straight to the problem and fix it.
Is my JSON sent to a server?
No. The formatter runs entirely in your browser with JavaScript. The JSON you paste is never uploaded, logged, or stored, and it clears when you close the tab. You can safely format sensitive data like API responses, config files, or tokens, and it works offline once the page has loaded.
Why is my JSON invalid when it looks fine?
The most common causes are trailing commas after the last item, single quotes instead of double quotes, keys without quotes, or comments, none of which strict JSON allows. JavaScript object syntax is more relaxed than JSON, so text copied from code often needs these small fixes before it will parse.
Does it show which line the JSON error is on?
Yes. Browsers report a character position, which is useless in a long file, so the tool converts it into a line and column number and prints the offending line with a caret under the exact spot. You can jump straight to that line in your editor and fix it.
Can I sort JSON keys alphabetically?
Yes. Turn on "Sort keys A-Z" and every object is rewritten with its keys in alphabetical order, recursively, while arrays keep their original order. It makes two versions of a config or an API response much easier to compare in a diff, since key order stops being noise.
How much space does minifying JSON save?
It depends on how much whitespace the original had, but stripping indentation and line breaks commonly cuts 15% to 30% off a formatted file. The tool shows the exact percentage saved when you pick Minify, along with the final size, so you can see the gain for your own payload.
Can it handle a large JSON file?
Yes. Formatting and validation use the browser native parser, which handles multi-megabyte files quickly. Syntax colouring is switched off automatically above roughly 150 KB so the page stays responsive, but the formatting, validation, copy, and download all keep working normally.
Why does my JSON with comments fail?
Strict JSON has no comments. Formats like JSONC or JSON5 allow them, plus trailing commas and unquoted keys, but the standard parser rejects all of that. Remove the comments and trailing commas, or convert the file first, and it will parse and format normally here.
Related tools
DeveloperToken CounterCount tokens exactly, check the context window, estimate the cost.- DeveloperText Diff CheckerCompare two texts and see exactly which words changed.
DeveloperBase64 Encoder / DecoderEncode text, images and files to Base64, and decode them back.
DeveloperTimestamp ConverterConvert Unix timestamps to dates and back, in any unit.
DeveloperSlugifyTurn any text into a clean URL slug, one or a whole list.
Last updated: September 17, 2026