JSON formatter and viewer
Paste JSON or open a file to format it in your browser. Use syntax highlighting, a collapsible tree, path copying, automatic fixes, minification and downloads.
json ยท format ยท view
Format JSON ยท Explore the tree
Paste API responses, configuration files or JSON logs. Use the highlighted code and tree view to understand the structure.
Paste JSON or drag in a .json file, then format, minify or explore it in the tree view.
Waiting for JSON inputJSON formatter and viewer guide
This JSON formatter and viewer makes long, single-line API responses, webhook payloads, configuration files and log data easier to read. It validates pasted text with JSON.parse, then formats it with your chosen indentation, syntax highlighting and line numbers. A collapsible tree view helps you explore nested structures. Click a key in the tree to copy an access path such as data.users[0].email, or switch to minified JSON without extra whitespace. All processing runs in the current browser; your input is not uploaded to the Toolvil server.
A misplaced bracket or comma can make an entire JSON document fail to parse, so locating errors quickly matters. When parsing fails, the page shows the browser error detail and an approximate position when available. It also offers automatic fixes for common patterns such as single quotes, trailing commas, unquoted keys and comments. Use it to inspect API responses, no-code automation data, analysis exports or CMS settings in a mobile or desktop browser without installing an application.
When this tool is useful
- An API response or webhook log arrives as a single JSON line that is difficult to read.
- You need to copy an access path to a value inside deeply nested JSON.
- You want to correct common syntax mistakes in a JavaScript object literal or malformed JSON.
Before you start
- Remove personal information, tokens and secret keys before sharing JSON.
- Minification removes whitespace; code view is better for a document that people need to read.
- Sorting keys changes object display order while retaining array order.
How to use
- Paste text into the JSON input or drag a .json file into it.
- Inspect the highlighted result in Code view or explore collapsible structures in ๐ณ Tree view.
- Click a key in the tree to copy a path such as data.users[0].email.
- If a fix is available for an error, use the automatic-fix banner and check the corrected JSON.
- Apply minification or key sorting, then copy the result or download it as .json.
Code view and tree view
Code view shows formatted JSON with indentation, line numbers and different colors for keys, strings, numbers, booleans and null. Tree view displays objects and arrays as a hierarchy that you can expand or collapse. For deeply nested data or large arrays, scan the tree first and click the key you need to copy its path. Check path notation for unusual key names before using it in code.
Errors the automatic fix can handle
The automatic-fix engine replaces single quotes with double quotes, removes trailing commas, quotes bare keys and strips // and /* */ comments. It can help turn JavaScript object literals copied from a development console into standard JSON. This is a helper for common patterns, so inspect the corrected output and confirm that it still represents your intended data.
Understanding minification and key sorting
Minification removes unnecessary whitespace to produce a compact single-line result. Key sorting makes object-key order more consistent when comparing JSON structures. Array order often carries meaning, so this tool retains the order of array items. Use formatted code for reviews or documentation and minified output when a compact representation is useful.
Unicode escapes in JSON strings use hexadecimal values. To inspect the value represented by an escape or convert it to decimal, use the number base converter.
This utility checks JSON syntax and formats its presentation. It does not replace a security review, schema validation or API contract tests. Remove sensitive values before entering data and use separate tests and schema checks before deploying a service.
FAQ
How do I copy a path from tree view?
In the output panelโs ๐ณ Tree view, click a key name to copy a path such as data.users[0].email to the clipboard. Review the path syntax for your key names and programming language; Python typically needs bracket notation.
Which errors can the automatic fix handle?
It replaces single quotes with double quotes, removes trailing commas, quotes bare keys and strips comments. If parsing fails and a fix is available, a banner lets you apply it with one click. This can help convert a JavaScript object literal into standard JSON. Always inspect the corrected data.
Can I upload or drag and drop a file?
Yes. Use ๐ Open file or drag a .json file into the input area. Save the formatted result as a .json file with ๐พ Download. All processing happens in your browser.
Does sorting keys change array order?
No. Only object keys are sorted; array item order stays the same. Consistent key order can help you compare JSON with the same structure or review changes in code.
Is my JSON sent to a server?
No. JSON parsing, formatting and visualization run 100% in the current browser, and your input is not uploaded to the Toolvil server. Remove API keys, tokens and personal information before sharing any output.
๐ Detailed instructions: How to format and validate JSON