JSON Formatter
Paste JSON to format it, check it or shrink it. It stays in your browser.
https://flxcode.com/json-formatter/
Stays in this page. Nothing is saved, shared or sent. Text up to 1 MB. For larger JSON use Open file (up to 50 MB).
Paste JSON to format it.
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.
Problem or idea? Email us
Quick start
- Paste JSON in the left box, or choose Open file.
- Pick 2 spaces, 4 spaces, tab or minify. The result updates by itself.
- If the text is not valid, the page shows the line and column and a caret under the problem.
- Copy the result, or download it as
formatted.json.
Why there is no save or share
In November 2025 researchers found two popular formatter sites publishing saved JSON on public pages, passwords and keys included (source: BleepingComputer). This page has no save or share feature. Nothing you paste is put in the address, stored in the browser or sent to us.
You can check that: load the page, turn off Wi-Fi, and format something. It still works.
What it keeps exact
- Numbers are not converted.
12345678901234567890,1.0,-0and1E+5come out the way you wrote them. - Strings keep their escapes.
éstaysé, and emoji written as a surrogate pair stay as written. - Key order stays as is, unless you tick Sort keys. Sorting is by UTF-16 code unit, so capital letters come before small ones.
- Duplicate keys are kept and reported.
Common errors
- Trailing comma. A comma before
}or]. Remove it, or use the Fix button. - Single quotes. JSON strings and keys use double quotes only.
- Comments.
//and/* */are not JSON. They are common in config files that are really JSON5 or JSONC. - Leading zeros.
01is not a number in JSON. Write1, or quote it as a string. - NaN, Infinity, undefined. None of them exist in JSON. Use
nullor a string. - Line break inside a string. Write
\n.
Limits
No tree view, no conversion to XML or CSV, no loading from a link (that would need a request to another site). The Fix button only removes comments and trailing commas. It does not guess at anything else.
How it works and privacy
A small parser reads the text once, checks it and writes it back with new spacing. Files go to a background worker. We count events without cookies, like "format used" (details). Your JSON is never part of them.
FAQ
Is it safe to paste secrets here?
The text is handled in your browser and is not uploaded, saved or put in the address. Even so, a habit of pasting passwords and keys into any website is a risky one. Remove secrets you do not need to look at.
Why are the error messages different from my browser's?
The page does not use the browser's own error text, which differs between browsers. It reads the text itself and tells you the line, the column and what it expected.
Are comments and trailing commas allowed in JSON?
No. JSON has no comments, and a comma before } or ] is an error. The page shows the error first. The button "Fix comments and trailing commas" removes them from your text when you ask, and tells you how many it removed.
What happens to very large numbers?
They stay as you wrote them. 12345678901234567890 comes out as 12345678901234567890. Many tools parse numbers as 64-bit floating point first, which turns this into 12345678901234567000. The same goes for 1.0, which stays 1.0.
What about duplicate keys?
JSON.parse keeps the last value and says nothing. The page keeps both in the output and warns you with the key and the line.
How big can the JSON be?
Pasted text up to 1 MB. Files up to 50 MB with Open file. Files are handled in a background worker so the page stays usable. Results over 2 MB are not shown on the page, you download them.
Does sorting keys change my data?
It changes the order of keys in objects, at every level. Array order stays. Programs that read JSON by key name do not care, but a diff will look different. It is off by default.
Which JSON version does it check?
The standard grammar from RFC 8259: double-quoted strings, no comments, no trailing commas, no NaN or Infinity. A byte order mark at the start is ignored.
More from FLXCode
Regex TesterNew
Test JavaScript regular expressions with live matches, groups, flags and a replace preview. Runs in your browser.
Password GeneratorNew
Make a random password or passphrase in your browser. See the entropy and its formula. Nothing is sent.
UUID GeneratorNew
Make version 4 or version 7 UUIDs in your browser, 1 to 1,000 at a time. Copy or download as .txt.
Case ConverterNew
Change text to sentence case, Title Case, UPPERCASE, camelCase, snake_case and more. Copy any result.