Format JSON Online Free — JSON Beautifier, Validator & Minifier
What's included
Features
About this tool
Format, Repair, and Explore JSON — Validate, Minify, Sort Keys, Find Paths
You got a wall of minified JSON back from an API and can't read it. You copied a JavaScript object from console.log and it won't parse. You're getting a mysterious "Unexpected token" error somewhere in a 500-line config file. Or you need to find the exact dot-notation path to a deeply nested field before writing any code. This tool handles all of it — paste your JSON and it instantly beautifies, validates, repairs, and gives you full syntax highlighting, right in your browser.
The Repair button is the thing most JSON formatters don't have. Real-world JSON breaks in predictable ways: JavaScript object literals have unquoted keys (name: instead of "name":), single-quoted strings, trailing commas, and values like undefined and NaN that aren't in the JSON spec. Python dicts use True, False, and None instead of true, false, null. Pasted content from Google Docs or Word uses curly/smart quotes instead of straight quotes. Repair fixes all of these in one click — it converts the input to valid JSON, formats it, and saves it to history so you can undo.
The JSON path feature solves a different problem: you have a deeply nested response and need to know exactly how to reference a field in code. Click any line in the tree view and the bottom bar shows the full path — $.orders[0].billing.address.city — ready to paste into your JavaScript, Python, or JSONPath query.
Need to go the other way? Minify strips all whitespace to a single line for curl bodies, environment variables, and database fields. Sort Keys alphabetically reorders every key at every nesting level — essential before diffing two JSON objects so your diff only shows genuine value changes instead of key-order noise. Wrap toggle lets you read long minified lines without horizontal scrolling.
Everything runs 100% in your browser. Nothing is uploaded to any server. Paste auth tokens, user records, payment data — it all stays on your machine. No account, no install, no rate limits.
Step by step
How to Use
- 1Paste or upload your JSONPaste raw or minified JSON directly into the left input panel. You can also click Upload JSON to load a
.jsonfile from disk, or drag and drop a file onto the input panel. The formatter validates and syntax-highlights your JSON automatically as you type — a green indicator means valid, a red error banner shows the exact position of any syntax error. - 2Format or repair broken JSONClick Format or press
Ctrl+Enterto apply full beautification. Use the Indent dropdown to choose 2-space, 4-space, or Tab indentation. If your JSON has issues — JavaScript object with unquoted keys, PythonTrue/False/None, single-quoted strings, trailing commas — click Repair to auto-fix all common problems in one pass. - 3Explore the interactive tree viewAfter formatting, the right panel shows a collapsible tree view. Click any node to expand or collapse it. Use Collapse All / Expand All to control the entire tree. Click any line and the bottom status bar shows the full dot-notation path — for example
$.orders[0].billing.address.city— ready to paste into JavaScript, Python, or a JSONPath query. - 4Sort keys or minifyClick Sort keys to alphabetically reorder all object keys at every nesting level throughout the entire structure — essential before diffing two JSON objects to eliminate key-order noise. Click Minify to compress to a single compact line with all whitespace stripped — use the Wrap toggle to read long minified output without horizontal scrolling.
- 5Search the formatted outputClick the search icon (or press
Ctrl+F) to open the search bar over the output panel. Type to highlight all matches. Use the up/down navigation arrows to jump between results. This works in both flat text and tree view mode. - 6Copy, download, or check statsClick Copy Output to copy the formatted or minified JSON to your clipboard. Click Download to save it as
formatted.json. The stats bar under the output shows total key count, maximum nesting depth, and formatted byte size at a glance. - 7Use history to restore previous sessionsEvery Format, Minify, Sort keys, Repair, and Upload action saves an entry to the history panel (up to 15 entries, persisted in localStorage). Click History to open the panel and click any entry to restore that JSON instantly.
Real-world uses
Common Use Cases
Got questions?
Frequently Asked Questions
Paste the minified JSON into the input panel on the left. The formatter instantly applies indentation, line breaks, and syntax highlighting so you can read the nested structure. It also validates the JSON as you paste — if there's a syntax problem, you'll see the exact line and column number where the error is. Press Ctrl+Enter or click Format to apply full beautification. Use the indent selector to choose 2-space, 4-space, or tab indentation to match your project style. The formatted output is ready to copy or download.
Paste your JSON and the validator highlights errors in real time as you type. When your JSON is invalid, a red error banner shows the exact error message along with the line and column number — so you can jump straight to the problem instead of scanning the entire file. The validator catches trailing commas (valid in JavaScript but not JSON), single-quoted strings, unquoted object keys, mismatched brackets and braces, invalid escape sequences, and bare values like undefined or NaN.
Click the Repair button. JavaScript object literals differ from JSON in several ways that cause parse errors: keys are unquoted (name: instead of "name":), strings can use single quotes instead of double quotes, and trailing commas are allowed after the last property. The Repair function converts all of these to valid JSON automatically — it quotes unquoted keys, converts single-quoted strings to double-quoted strings, removes trailing commas, and replaces JavaScript-only values like undefined with null. It also handles Python dicts: True → true, False → false, None → null. After repair, the corrected JSON is formatted and ready to use.
Click Repair — it removes trailing commas automatically. A trailing comma error means there is a comma after the last element in an object or array: {"name": "Alice",} or [1, 2, 3,]. JavaScript allows this but the JSON specification does not. Repair strips all trailing commas throughout the entire structure in one click. If you want to fix it manually, the validator shows you the exact line and column number of the problem.
Click the Repair button. Python boolean and null literals (True, False, None) are not valid JSON — JSON requires lowercase true, false, null. The same applies to JavaScript-only values: undefined, NaN, Infinity, and -Infinity are not in the JSON specification. Repair replaces all of these with their valid JSON equivalents in one pass: True → true, False → false, None → null, undefined → null, NaN → null, Infinity → null. This is the common issue when serializing Python dicts to JSON without using json.dumps(), or when logging JavaScript objects that contain non-serializable values.
Format your JSON first, then click any line in the tree view. The bottom status bar instantly shows the full dot-notation path to that field — for example $.users[0].address.city. This tells you exactly how to access the field in JavaScript (response.users[0].address.city), Python (data["users"][0]["address"]["city"]), or a JSONPath query ($..city). Keys with special characters use bracket notation automatically: $.data["@type"] or $.config["content-type"]. This is faster than manually tracing brackets when working with deeply nested API responses.
Click the Minify button to strip all whitespace, line breaks, and indentation from your JSON, producing the smallest possible single-line string. This is the format used in API response bodies and stored database payloads to minimize bandwidth and storage. A typical 10KB pretty-printed JSON file compresses to 4–5KB minified. Use this before pasting JSON into an environment variable, a curl request body, a CloudFormation template, or any other field where whitespace is wasted space. Enable the Wrap toggle if you need to read the minified output without horizontal scrolling.
Click Sort Keys in the toolbar. This reorders all object keys alphabetically at every nesting level throughout the entire JSON — it's not just the top level, every nested object is sorted too. This is most useful before diffing two JSON objects: if both have the same fields but in different key order, sorting them first ensures the diff only shows genuine value differences, not spurious key-order noise. It also enforces consistent key ordering in config files before committing to version control.
Yes — this tool is completely free with no account, no login, and no extension or software to install. Everything runs in your browser. Paste your JSON, format it, and copy the result. There are no usage limits, no file size caps for typical API responses, and no ads that block access to the tool. The formatter works in Chrome, Firefox, Safari, and Edge on both desktop and mobile.
Yes, completely private. All JSON parsing, formatting, validation, minification, and repair runs inside your browser using the built-in JavaScript JSON.parse engine — nothing is uploaded to any server. You can safely paste API responses that contain authentication tokens, Bearer tokens, private user records, payment data, or any other sensitive content. When you close or refresh the tab, all pasted data is permanently gone.
Format and sort keys on both JSON objects using Sort Keys, then paste them into a diff checker to compare. Because Sort Keys alphabetically reorders all keys at every level, the diff will highlight only genuine value differences — not noise from different key ordering. This is the standard workflow for comparing API response schemas across versions, config files across environments, or OpenAPI spec definitions before and after a change.
Yes. The formatter handles multi-megabyte JSON files in the browser. Files up to a few MB typically parse and format in under a second on modern devices. For very large files — 10MB or more — the parse and render may take a few seconds since all processing happens in your browser's JavaScript engine. For extremely large datasets (100MB+), a terminal tool like jq is faster, but for typical API responses, config files, and database exports this formatter handles them without issues.
Click the Download button in the output panel to save the formatted JSON as a .json file. The downloaded file uses whichever indentation you selected (2 spaces, 4 spaces, or tabs) and reflects any transformations you applied — including key sorting and minification. This is useful when you want to commit a normalized, formatted config file to version control, or when sharing a readable API response with a teammate in a bug report.