JSON Formatter & Validator: format, beautify and fix JSON online.
Paste or upload your JSON to format it, check it for errors and explore it as a tree. It all happens in your browser.
Your input is processed in your browser. Nothing is uploaded.
Avoid pasting passwords or secret keys into any online tool.
Your JSON
0 characters
Drag a .json file onto the box, or click Upload. Everything stays in this tab.
Result
0 characters
Add JSON to see it formatted here.
How to format JSON online
- 1.Paste your JSON into the input box, upload a .json file or drag it onto the page.
- 2.The JSON validator checks it as you type. If something is wrong, you see the line and column of the problem.
- 3.Click Format to beautify JSON with 2 spaces, 4 spaces or tabs. Click Minify to remove all extra spaces.
- 4.Switch to the Tree view to open and close objects and arrays.
- 5.Copy the result or download it as a .json file.
Why use this JSON formatter and validator?
- Clear errors: the JSON validator shows the line and column of the problem and explains it in plain words.
- Fixes common mistakes: one click removes trailing commas and comments, fixes single quotes and shows you exactly what changed.
- Exact numbers: long numbers keep every digit when you format JSON, because the tool does not convert them first.
- Tree viewer: explore large files without scrolling through a wall of text, and copy the path of any value.
- Private: your JSON stays in your browser and is not uploaded — the JSON formatter never sees it.
- Free, with no sign-up.
How to fix common JSON errors
- Trailing comma: remove the comma after the last item in an object or an array.
- Single quotes: JSON needs double quotes around keys and text.
- Unquoted keys: put every key in double quotes.
- Comments: JSON does not allow // or /* */ comments.
- Missing comma: add a comma between two items.
- Special values: JSON has no undefined, NaN or Infinity. Use null or a string instead.
- Line breaks inside text: write \n instead of pressing Enter inside a string.
For a longer walkthrough, read Debugging JSON errors without guessing.
Format, beautify, minify and validate: what is the difference?
Formatting and beautifying mean the same thing here: adding line breaks and indentation so JSON is easy to read, which is how you beautify JSON for a person rather than for a program. Minifying does the opposite and removes the extra spaces to make the file smaller. Validating checks that the text follows the JSON rules — that is the JSON validator's job, and it runs while you type. This JSON formatter does all of them, and formatting only changes white space.
Tips before you format JSON
Keep a copy of your original. Check that your data is JSON and not a JavaScript object, because JSON keys always need double quotes. Sorting keys changes the order of keys, not the meaning of the data. Files up to about 20 MB work in a modern browser, but very large files can be slow. Avoid pasting passwords or secret keys into any online tool. Need to encode a value? Try Base64 Encode / Decode or URL Encode / Decode.
Common uses
Reading an API response, checking a settings file, cleaning up JSON before you commit it, finding the error in broken JSON, and sorting keys so two files are easier to compare. When a saved file refuses to load, the JSON validator tells you which line to fix. It also serves as a quick JSON formatter when you only want to read a response before pasting it into a document.
Frequently asked questions
Is this JSON formatter free?
Yes. There is no sign-up and no limit on how often you use it.
Is my JSON uploaded anywhere?
No. Everything happens in your browser and nothing is kept after you close the tab.
How do I validate JSON?
Paste it into the box. If it is valid you see "Valid JSON". If not, you see the line, the column and an explanation of the mistake.
What is JSON?
JSON is a text format for data. It uses objects in curly braces, arrays in square brackets, text in double quotes, numbers, true, false and null.
Why does my JSON show an error?
The most common reasons are a trailing comma, single quotes, keys without quotes, a missing comma or a missing bracket.
Does JSON allow comments?
No. Use "Fix common mistakes" to remove them.
How do I open a JSON file?
Upload it to this page and read it as text or as a tree. See How to open a JSON file.
Will formatting change my data?
No. Formatting only changes spaces and line breaks, and numbers keep their exact digits. Sorting keys changes the order of keys.
Want to open a .json file? Read How to open a JSON file and make it readable.
Toolezs