JSON Formatter – Beautify and Validate
Paste JSON or open a file; valid JSON is shown neatly indented, invalid JSON shows the line, column and reason of the error. Your data never leaves your device.
- JSON→ becomes { }
- No sign-up
- Runs on your device
61 JSON Formatter and Validator
- 01 Pick
- 02 Process
- 03 Download
Processed on your device · no upload
You opened this inside an app. To download without trouble, use the ••• menu and pick Open in browser.
Only the start of a long result is shown; use “Download JSON” for all of it.
Live status
Reading the file
Result
Ready.
0keys formatted
0 BYour data sent to our server: 0 bytes · processed on your deviceWhy 0: this page's security rule blocks sending data at browser level; everything happens in this tab. CSP · connect-src 'none' · form-action 'none'
Couldn't convert the file.
Numbers and strings are copied as written; no rounding and no change to escapes.
- The work is done in this tab, on your device.
- Numbers and strings stay exactly as written; only whitespace changes.
- No file is sent to our server; closing the tab clears everything.
Type or paste your text first
Stages
- Reading the file
- Formatting JSON
- Preparing the file
- Your file stays on your device
- No upload to our server
- Free, no sign-up
01
Why does JSON come out “invalid”?
JSON is the plain-text format that APIs, configuration files and apps use to exchange data. Its rules are strict: keys must be in double quotes, no comma may follow the last item, comments are not allowed and strings take double quotes, not single ones. A single missing comma is enough to make a whole file unreadable.
The error messages of browsers and programming languages often stop at something short like “Unexpected token”, sometimes without even saying where. In long JSON, or JSON squeezed onto one line, finding the mistake takes time.
This tool checks JSON as you type. If there is an error, it shows the line and column, the reason in plain words (“comma after the last item”, “single quotes used”, “key not in quotes”) and the faulty line with a marker. It beautifies valid JSON with 2 or 4 spaces or tabs, minifies it onto one line if you like and sorts keys alphabetically. Everything runs in your browser; the data is never sent to a server.
02
Format JSON in 3 steps
Paste JSON or open a file: Paste the text into the box or choose your .json file with “Open file” (up to 50 MB). It is checked as you type.
Fix the error: If there is an error, the line and column, the reason and the faulty line with a marker appear. The result refreshes as soon as you fix it. Duplicate keys are flagged separately.
Choose a format and take it: Pick Beautify or Minify, the indentation and, if you like, sorted keys. Take the result with “Copy” or save it as a file with “Download JSON”.
03
Who uses it, and for what?
Developers: Making API responses readable, finding the mistake in a request body, sorting keys to compare the configuration of two environments.
QA and support teams: Opening JSON squeezed onto one line in logs and inspecting its fields.
Data and reporting: Checking that an exported JSON file is intact and how many keys and levels it has.
Web and mobile development: Catching comma and quote mistakes in package.json, manifests and translation files before release.
Integrations: Reading and sharing the JSON sample of an invoicing, payment or shipping service with tidy indentation.
Students: Learning the JSON rules by trying them out together with the error messages.
04
Rules, limits and privacy
Strict and standard: Checks follow the RFC 8259 JSON rules. Comments, trailing commas, single quotes, unquoted keys, NaN and Infinity are errors and are shown with their reason.
Values never change: Numbers and strings are copied exactly as written. Long numbers like 12345678901234567890 are not rounded, 1.10 does not become 1.1 and escapes like \u00e7 are kept. Only whitespace and line breaks change.
Duplicate keys: Keys that appear twice in the same object are listed; many programs read only the last one, which can silently lose data.
Format options: 2-space, 4-space or tab indentation; minify onto one line; sort keys alphabetically (the order inside arrays never changes).
Large files: JSON up to 1 MB is checked as you type; larger text and files over 5 MB are processed in the background, so the page never freezes. The limits are 50 MB and 1,000 nesting levels.
Privacy: JSON is not uploaded or stored, so you can safely check responses that contain API keys or personal data. It is cleared from memory when you close the tab.
05
Privacy and automatic deletion
This tool does not send your file to our server: all processing happens in your browser, on your device. The page is served with a security policy (Content-Security-Policy) that technically prevents the file's contents from being sent anywhere; no analytics or advertising scripts run on this page.
The result file is also created on your device and only you download it. It is cleared from the browser's memory when you close the tab or choose “New file”. Our server keeps no file name or content record of this processing.
06
Frequently Asked Questions
Where is the error in my JSON, and how do I find it?
Paste the JSON into the box; if there is an error, the line and column, the reason and the faulty line with a marker are shown. The most common causes are a comma after the last item, single quotes, unquoted keys and a missing comma between two items.
What does “Unexpected token” mean?
It means the parser met a character it did not expect at that point: usually a missing or extra comma, quote or bracket. This tool reports the same situation with a plain reason such as “missing comma between items” or “comma after the last item”, together with its position.
Can I use comments in JSON?
Standard JSON does not allow comments; a file with // or /* */ fails in most programs. The tool reports a comment as an error. If you need comments, remove them or use a format that supports them, such as JSONC or YAML.
Will formatting change my numbers?
No. Numbers and strings are copied exactly as they appear in the file; only spaces and line breaks change. So 19-digit IDs or values like 1.10 stay unrounded, unlike in many other tools.
How do I minify JSON onto one line?
Choose “Minify” in the options on the right: all spaces and line breaks are removed and the JSON fits on one line. Copy the result or save it as a .json file with “Download JSON”.
Why sort keys alphabetically?
When two JSON files list their keys in a different order, every line looks changed in a comparison. “Sort keys” puts both files in the same order so a text compare shows only the real differences. The order of items inside arrays does not change.
Is my data sent to a server?
No. Checking and formatting happen in your browser, and the page comes with a security policy that technically blocks connections to the outside. You can safely use it with JSON that contains API keys or customer data.