How to Edit JSON Config Files using Free JSON Editors or Notepad++

JSON (JavaScript Object Notation) is gaining popularity as a format for configuration files. Unlike XML or the still-used INI format, editing JSON in a text editor can be tedious and error-prone. However, there are free JSON editors and plugins for Notepad++ that simplify this task.

Initially intended for platform-independent serialization of JavaScript objects, JSON is typically generated by machines. However, as it becomes more prevalent for configuration files, there is a growing need to edit JSON interactively.

Recent examples include settings.json for Windows Terminal or exporting the Start menu layout to distribute it to other computers.

Due to its numerous brackets and peculiar comma placement, JSON is highly susceptible to syntax errors. Manually searching for these errors can be cumbersome. While it’s possible to update JSON files with PowerShell programmatically, this approach is often too complex for ad-hoc tasks.

There are recommended alternatives, in the form of specialized JSON editors. These editors ensure to maintain the syntax by providing individual fields for entering object names and values. Multiple free implementations for windows and online services are accessible for accomplishing this task.

Also, editors such as Notepad++ or Integrated Development Environments (IDEs) like Visual Studio Code can be transformed to support JSON. However, merely adding features such as validation or IntelliSense doesn’t make them JSON editors in the real sense.

JSONedit

The creator of JSONedit, Tomasz Ostrowski, portrays his software as a basic editor, despite housing several interesting features. JSONedit offers text, tree, and list views for JSON files.

The program functions just like other editors in text mode, enabling you to change the file as needed. However, it stands out from Notepad++ by providing JSON-centric features to restructure the content and confirm its syntax.

The tree view proves beneficial for management of deeply nested structures. It is superior to a flat representation in the way it provides a comprehensive overview. An entry, when chosen, displays its data type, name, and value in different fields, enabling seamless editing.

Editing a JSON node in tree view.

In the tree view, new nodes can be added either on the same level (“Sibling”) or below (“Child”). In addition, it allows cloning, deleting or moving already existing entries (cut and paste). For the manipulation of arrays, the software provides a separate editor, but the precondition is that the array must already exist.

The list view is primarily suitable for flat structures and offers the advantage that you can edit values directly within their field.

Edit a JSON object in the list view

Availability

JSONedit can be downloaded for free from the author’s website. Therefore, it does not require installation and is suitable for portable use.

JSON/XML Editor

This is a basic tool when compared to JSONedit. The only feature available is a tree view where individual nodes can be selected and edited in terms of their name, value, and data type directly within their specific fields.

There is a corresponding command offering the selection between Object, Array, and Value for the purpose of inserting new elements. Thus, creating an array is more straightforward than with JSONedit. Since there is no allowance for free text input and the syntax is unfailingly correct, no command for validation is provided by the JSON/XML Editor.

Click here to see an example of editing JSON arrays in the JSON/XML editor.

However, if you open a JSON file, the program checks its correctness and offers to correct any errors automatically.

When loading an incorrect file, the editor offers an automatic correction

Availability

JSON/XML Editor can be obtained for free from the Microsoft Store. However, it is not a Store app but a Win32 program that is installed using an MSI installer.

Plugins for Notepad++

Notepad++ currently offers two JSON extensions in its plugin manager: JSONTools and JSON Viewer. Both provide a tree view of the JSON structure in a separate pane, but neither plugin turns Notepad++ into a regular JSON editor, as editing is only possible in the normal text window.

Both extensions can automatically format or compress JSON. JSON Viewer also offers syntax validation, while JSONTools supports multiple tests and checks irrelevant to the intended application.

Tree View of JSONTools

Tree View of JSONTools

The tree view in JSONTools is synchronized with the text representation so that the corresponding section in the file is consistently highlighted as you navigate through the tree structure. This feature is not available in JSON Viewer.

Availability

Both tools can be found and installed through the search function of the plugin manager.

Summary

It is recommended to use a specialized editor to edit configuration files in the delicate JSON format. Among the most well-known apps for Windows are JSONedit and the JSON/XML Editor.

The first offers significantly more features, including three views for the JSON structure. However, this tool makes some tasks more challenging than necessary, especially when creating arrays.

The JSON/XML Editor is much more straightforward but does what it’s supposed to in our context. It is limited to a tree view, and the absence of text representation avoids errors. If it detects any errors while loading a file, it can correct them.

Subscribe to 4sysops newsletter!


Posted

in

,

by

Tags: