Online JSON Formatter, Validator & Diff Tool
Format JSON online for free. Paste, upload, or fetch JSON and instantly beautify it into readable, indented code, validate it as you type, compare two documents, or minify it for production. Everything runs in your browser, so your data is never uploaded.
How to format JSON online
- Paste your JSON into the editor, drop a
.jsonfile onto the page, or load it from a URL. - Pick an indent size: 2 spaces, 4 spaces, or tab.
- Click Format or press Ctrl+Shift+F to beautify. Click Minify (Ctrl+Shift+M) to strip all whitespace instead.
- Use Copy or the export menu to take the result with you.
Need to tidy an object for a diff or a config file? Sort Keys (Ctrl+Shift+S) orders every key alphabetically.
JSON validator with clear error messages
As you type or paste, the editor validates your JSON in real time. Syntax errors are shown immediately with the line and column where parsing failed, so you can jump straight to the problem. The most common mistakes are:
- Trailing commas after the last item in an object or array.
- Single quotes instead of double quotes around strings.
- Unquoted keys, such as
{name: "Ada"}instead of{"name": "Ada"}. - Comments (
//or/* */), which JSON does not allow. - Missing commas or brackets between items or at the end of a block.
- Python or JavaScript values like
True,None,undefined, orNaN.
When JSON is invalid, a Repair JSON button appears. It removes comments and trailing commas, quotes bare keys, converts single quotes, and maps those Python and JavaScript values to valid JSON. If the result still does not parse, it leaves your text untouched. See also JSON Prettier, a page built around pretty printing and fixing broken JSON.
JSON tree viewer
Switch to the Tree Viewer tab to explore your data as a collapsible hierarchy. Each node shows its key, value type, and item count. Click any value to copy it, use search to find keys or values, and follow the breadcrumb bar through deeply nested structures. A table view is available for arrays of objects, and you can hide fields you do not need with the filter.
JSON diff: compare two JSON documents
The Diff tab shows two documents side by side and highlights what was added (green), removed (red), or changed (yellow), with the full path to each difference. It is useful for comparing API responses between environments, checking a config change, or reviewing a database export.
Convert and export JSON
Export JSON as CSV for spreadsheets or as YAML for configuration files, download the formatted or minified result, or import CSV and turn it back into JSON. The Code Gen tab generates model code from your data in TypeScript, C#, Java, Python, Go, Rust, Kotlin, or Swift, so you can go from an API response to a starting type in a few clicks.
Private by design
There is no backend. Formatting, validation, diffing, and conversion all happen in your browser, so API responses, tokens, and customer data stay on your device. The app is a Progressive Web App: after your first visit it works offline and can be installed on desktop or mobile.
More tools
- JSON Prettier: pretty print JSON and repair invalid JSON.
- JSON Validator: check JSON syntax and find errors.
- JSON Diff: compare two JSON documents.
- JSON to CSV: convert JSON to CSV and back.
- JSON to YAML: convert JSON to YAML.
- JSON Minifier: remove whitespace from JSON.
- JWT Decoder: decode a JSON Web Token and inspect its header, payload, and expiry.
- Common JSON Errors: causes and fixes for invalid JSON.
- Changelog: what is new in each release.
Frequently asked questions
What is JSON?
JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format. It is easy for humans to read and write, and easy for machines to parse and generate. JSON is widely used for APIs, configuration files, and data storage.
Is my data safe?
Yes. This tool runs entirely in your web browser. Your JSON data is never transmitted to any server, stored in any database, or shared with third parties. There is no backend — it is a static HTML, CSS, and JavaScript application.
Does it work offline?
Yes. This JSON viewer is a Progressive Web App (PWA). After your first visit, it is cached by a service worker and works without an internet connection. You can even install it as a standalone app on desktop or mobile.
What browsers are supported?
All modern browsers: Chrome, Firefox, Safari, Edge, and Opera. The app uses standard web APIs and has no external dependencies.
How do I format JSON?
Paste your JSON into the editor and click the Format button in the toolbar, or press Ctrl+Shift+F. The JSON will be reformatted with 2-space indentation.
How do I minify JSON?
Click the Minify button or press Ctrl+Shift+M to remove all whitespace and produce the most compact JSON representation.
Can I search inside JSON?
Yes. In the Tree Viewer tab, use the search bar to find keys or values. Results are highlighted and you can navigate between matches with the arrow buttons.