What this JSON formatter does
Paste any JSON and press Format (or Ctrl+Enter) to get clean, indented JSON with 2 spaces, 4 spaces or tabs. Minify removes every unneeded space so the payload is as small as possible for an API request or a config file. Validate checks the text against the JSON standard (RFC 8259) and tells you, in plain language, exactly what is wrong and where: the line, the column and a small snippet with a caret under the problem character.
Everything happens inside your browser tab. Nothing is uploaded, which matters when the JSON is an API response with customer data, an access token, or a production config. You can switch off your internet after the page loads and the tool still works, and you can install it as an app from the header.
Why this one is different
- Big numbers are kept exactly. Many online formatters run
JSON.parseandJSON.stringify, which silently changes IDs such as12345678901234567890into12345678901234567000. Our Format and Minify work on the original tokens, so long order IDs, Twitter/X snowflake IDs and bank reference numbers survive untouched. If such numbers exist, the tool warns you before you use Tree view, Sort keys or a conversion, because those steps do use JavaScript numbers. - Key order and duplicate keys are preserved while formatting, so the output is the same document, only prettier.
- Friendly error messages. Instead of “Unexpected token”, you see messages such as “Trailing comma before } is not allowed”, “Single quotes are not allowed in JSON” or “Line break inside a string. Use \n instead.” Press Go to error to jump the cursor straight to the problem.
- One-click Repair. Repair fixes the most common copy-paste mistakes: trailing commas, single quotes, unquoted keys, JavaScript comments, Python
True/False/None,NaN/Infinity, raw line breaks inside strings, and missing closing brackets at the end. It then formats the result and validates it again. - Collapsible tree view with JSONPath. Large documents open lazily, so a 1 MB file does not freeze the page. Hover any row and click its path chip to copy a path such as
$.books[1].tags[0], ready for jq, JSONPath libraries, Postman tests or JavaScript code. - Conversions built in: JSON to CSV and TSV (nested objects are flattened to
address.citystyle columns), CSV to JSON with automatic delimiter detection, JSON to YAML and YAML to JSON, and escaping text into a JSON string or back. - Hindi and English interface, dark mode, keyboard shortcuts, drag-and-drop files, and a private history of your last inputs stored only in your own browser.
How to use it, step by step
- Paste JSON into the left box, drop a
.jsonfile onto it, or click Open file. Auto-format on paste is on by default. - Choose the indent, then press Format. If the JSON is invalid, read the red message and press Go to error, or try Repair.
- Switch to Tree view to explore the structure. Use Expand all for small files; for large files open only the branches you need.
- Use Copy, Download (Ctrl+S) or the ⇄ button to send the output back to the input for another step, for example Format → JSON to CSV.
Common JSON errors and how to fix them
Trailing commas
JavaScript allows [1, 2, 3,] but JSON does not. Remove the final comma or press Repair.
Single quotes and unquoted keys
Text such as {name: 'Asha'} is a JavaScript object literal, not JSON. JSON needs {"name": "Asha"}. Repair converts both.
Comments
Standard JSON has no comments. Files like tsconfig.json use a relaxed format (JSONC). Repair strips // and /* */ comments so the data can be read by a strict parser.
Line breaks and tabs inside strings
A string must stay on one line; write a new line as \n and a tab as \t. Repair escapes raw line breaks for you.
Several JSON values in one file
Log files often contain one JSON object per line (NDJSON). A single JSON document can only hold one value, so wrap them in [ ] and separate them with commas to inspect them together.
JSON to CSV: how nested data is handled
CSV is a flat table, so each object in a top-level array becomes a row. Nested objects become dotted columns (address.city, address.pin), arrays are written as JSON text in one cell, and every key seen in any row becomes a column, so rows with missing fields stay aligned. Cells containing commas, quotes or line breaks are quoted according to RFC 4180, which Excel, Google Sheets and LibreOffice all read correctly. Choose TSV if you want to paste straight into a spreadsheet.
Privacy and limits
The tool has been tested with inputs over 1 MB, Hindi and emoji text, and malformed files. Very large files (tens of MB) depend on your device's memory. History keeps your last twelve inputs below 250 KB each in localStorage; clear it at any time from the History window. Nothing is sent to our server or to any third party.
Frequently asked questions
Is my JSON uploaded anywhere?
No. Parsing, formatting and conversion run in JavaScript inside your browser tab. You can disconnect from the internet after the page loads and it keeps working.
Why did another formatter change my long ID numbers?
JavaScript numbers are 64-bit floats, exact only up to 9,007,199,254,740,991. Tools that parse and re-stringify round larger values. Our Format and Minify keep the original digits, and the tool warns you when a step would round them.
How do I find the error in invalid JSON?
Press Validate or Format. The message shows the line and column, a snippet with a caret under the problem, and a plain-language reason. Go to error moves the cursor there.
What does Repair change?
It removes comments and trailing commas, converts single quotes to double quotes, quotes bare keys, turns True/False/None into true/false/null, replaces NaN and Infinity with null, escapes raw line breaks in strings and closes missing brackets at the end. Always review the result.
Can it convert JSON to Excel?
Use JSON → CSV or JSON → TSV, then open the downloaded file in Excel or paste TSV directly into a sheet. Nested fields become dotted column names.
How large a file can it handle?
It is tested with files over 1 MB. Formatting multi-megabyte files works on most laptops; the tree view loads branches only when you open them so it stays responsive.