Feature

JSON Inspector offers a user-friendly interface with two panels, each capable of displaying different JSON documents. The left and right panels provide various editing modes, including code, tree, form, and more.

In code mode, the JSON document is presented as plain text, which is familiar to developers. This mode displays the JSON text exactly as it is, including white spaces, indentation, and delimiters such as quotes, commas, and semicolons. Users can freely edit the JSON, format it according to their preferences, or even make it more compact.

On the other hand, tree mode presents the JSON in a high-level editor that prioritizes the data rather than specific formatting details. This mode proves especially useful when dealing with large JSON documents, as it allows for easy copying, pasting, transforming, and extracting of specific sections. Additionally, the tree mode supports highlighting the differences between two JSON documents, facilitating comparison and analysis.

This page serves as an overview of the diverse features available in JSON Inspector.

Edit and view

When working with JSON data, it is common to need to inspect its contents, search for specific information, analyze it, or make modifications. JSON data received from a server is usually compacted (minified), making it challenging for developers to read. However, JSON Inspector simplifies the task of viewing and editing JSON data, providing a user-friendly solution.

Beautify and format

One of the most commonly utilized features is the capability to format and beautify JSON. You can effortlessly paste the data into the editor or conveniently drag and drop it to visualize the structure of a JSON document. By clicking the Beautify button, the document is instantly organized in a visually pleasing manner. In tree mode, the document is automatically rendered in a user-friendly format, eliminating the need to click the Beautify button. When copying data, it is formatted by default, ensuring optimal readability. Furthermore, the menu provides a Download button, enabling the option to download the document in either a formatted or minified form.

Transform, query, sort, and filter

JSON Inspector provides robust tools for querying and processing JSON documents, offering support for filtering, sorting, and transforming data.

For sorting an array based on a specific nested property, users can utilize the Sort modal. By opening the modal, they can select the desired property from the dropdown menu and specify the sort order (ascending or descending). The Sort modal can also be used to sort object keys. In tree mode, sorting can be applied to the entire document or a selected nested object or array.

To filter and transform JSON documents, the Transform modal is available. Users have the flexibility to write queries for data processing. The tool supports two query languages: JMESPath and JavaScript with Lodash. JMESPath enables concise queries, while JavaScript and Lodash offer developers the advantage of familiarity and ease of use due to their association with JavaScript.

The Transform modal incorporates a Wizard feature, which presents a graphical user interface for constructing queries. Users can conveniently select properties to filter, sort, or choose from dropdown menus. The dropdown menus are dynamically populated based on the data structure of the document, ensuring an intuitive and efficient querying experience.

Compare

JSON Inspector enables you to conveniently compare the differences between two JSON documents. To initiate the comparison, open the respective documents in the left and right panels, and activate the highlighting of differences by clicking the Compare button positioned between the two panels. If you haven't already, switch both panels to tree mode for a clearer visualization of the differences.

The editor employs a swift and advanced algorithm that performs a data-level comparison between the documents, rather than a text-level comparison. This algorithm disregards disparities in formatting, white spacing, and the order of object keys, as these do not alter the meaning of the data. Furthermore, the algorithm is adept at detecting inserted and deleted items within an array, accurately highlighting such changes during the comparison process.

Repair

Encountering a broken JSON document that requires transformation into valid JSON? Handling newline-delimited JSON data extracted from a log file? Converting a JavaScript object, without double quotes, from a JavaScript or Python codebase into JSON? Working with query results from MongoDB that involve comments and special data types such as NumberLong(2) or ISODate("2012-12-19T06:01:17.171Z")?

JSON Inspector streamlines the process for you. Simply drop the data into the editor, and in many cases, it automatically repairs the JSON. If automatic repair is not possible, the editor provides guidance and assistance in identifying and resolving the issue, ensuring that the JSON becomes valid and usable once again.

Validate

JSON Inspector immediately validates any opened documents to ensure they adhere to the JSON format. If a document is found to be invalid, the editor displays a warning message and, in many cases, provides an option to automatically repair the document.

In addition, JSON Inspector offers the functionality to validate the structure of JSON documents using Ajv, a JSON Schema validator. Users have multiple options for loading a JSON schema document, such as loading a schema in the left panel and the document in the right panel or linking to a URL. Validation issues are conveniently presented inline within the editor, and a summary of the issues is provided at the bottom. By clicking on an issue in the summary list, the editor automatically scrolls to the corresponding location in the document, facilitating quick identification and resolution of validation concerns.