How to Format JSON in Notepad++ (Step-by-Step Guide)


In the developing world, JSON (JavaScript Object Notation) is a widely used data format for APIs, configuration files, and data exchange between web applications by developers. However, working with unformatted JSON can be a big headache for beginners and advanced users because it makes debugging hard. Therefore, here we are with a solution for those using NotePad++.

Notepad++ is a common application for writing and formatting codes, mainly by developers. However, one thing missing from this text application is that you will not have the built-in JSON formatted. But don’t worry; we can solve this problem by installing plugins like JSON Viewer or JSTool to easily format, beautify, and validate JSON using plugins like JSON Viewer or JSTool.

In this article, we learn how to install a JSON formatter in Notepad++ and then format JSON step by step. So, whether you’re a developer, data analyst, or just someone dealing with messy JSON files, this tutorial will help!

How to Install a JSON Formatter Plugin in Notepad++

We cannot perform JSON formatting in Notepad++ by default because it doesn’t support that; hence, we need to install a Plugin. For this purpose, there are two popular plugins available: one is JSON Viewer (lightweight & simple to use), and the other is JSTool (offers both formatting and validation)

  1. Click on Windows /Linux/macOS open NotePad++
  2. Once you are on Notepad++, click on the Plugins from the menu and select the Plugins Admin option.
  3. After that, in the search box of the Plugins section, search for “JSON Viewer”.
  4. Once you find the JSON Viewer Plugin, check the box available next to it; otherwise, the “Install” button will be greyed out.
  5. Finally, click the “Install” button, and the plugin will be configured on your system for Notepad++
  6. Close and reopen Notepad++ once the installation is complete.
Install JSON Viewer Plugin Notepad++

Method 2: Install JSTool Plugin (Alternative Option)

Those who don’t want to use the JSON Viewer plugin can use the JSTool Plugin. The installation method will be the same.

  1. On your Notepad++, click the Pluigns option from the menu.
  2. Select the Plugins Admin option.
  3. Check the box given there for JSTool Plugin and then click the Install button.
  4. Confirm the installation, and soon, the plugin will be on your Notepad++.
  5. Restart Notepad++ to enable the plugin.
Install JSTool Plugin Notepad++ windows

Once installed, you’ll see new options in the Plugins menu for formatting, minifying, and validating JSON.


How to Format and Beautify JSON in Notepad++

Once you have installed the plugin, either JSON Viewer or JSTool, paste the code you want to format in NotePad++ to make it more readable:

Using JSON Viewer Plugin

  1. Copy your raw JSON data.
  2. Open Notepad++ and paste the JSON.
  3. Go to “Plugins” > “JSON Viewer” > “Format JSON“.
  4. Your JSON will now be properly formatted and easy to read.
Format JSON
How to Format Json code in NotePad++

Using JSTool Plugin

Similarly, as we did with JSON Viewer, users can do the same with the JSTool plugin.

  1. Copy and paste your JSON data into Notepad++.
  2. Go to “Plugins” > “JSTool” > “JSFormat“.
  3. Your JSON will be formatted into a structured, indented format.

💡 Tip: You can use the shortcut Ctrl + Alt + Shift + J in JSON Viewer to format JSON quickly.

Alternatively, you can use our free Online tool – JSON Formatter and Validator.


How to Minify or Compress JSON for Compact Storage

What if you want formatted JSON back to unformatted one? To do this, we need to minify or compress JSON code, which removes all unnecessary whitespace, making it smaller and more efficient for storage or transmission. Hence, gives you unformatted JSON code.

Minify JSON Using JSON Viewer Plugin

  1. Paste your JSON data into Notepad++.
  2. Go to “Plugins” > “JSON Viewer” and select the “Compress JSON” option. You can also use the shortcut Ctrl+Alt+Shift+C.
  3. The JSON will be converted into a single-line format.
Minify or Compress JSON

Minify JSON Using JSTool Plugin

Similarly, if you want to use the JSTool plugin, then go to NotePad++ and follow the given steps.

  1. Paste your JSON data into Notepad++.
  2. Go to “Plugins” > “JSTool” > “JSMin”.
  3. Your JSON will be compressed into a smaller file size.

🔹 Before Minification:

{
    "name": "John Doe",
    "age": 30,
    "city": "New York"
}

🔹 After Minification:

{"name":"John Doe","age":30,"city":"New York"}

Minified JSON is great for reducing file size and improving performance in web applications.


How to Validate JSON in Notepad++

Sometimes, JSON files contain errors (missing brackets, commas, or incorrect formatting). To check for errors, you can validate your JSON using Notepad++.

Validate JSON Using JSON Viewer Plugin

  1. Paste your JSON into Notepad++.
  2. Select the JSON text you want to validate.
  3. Press Ctrl + Alt + Shift + J (shortcut for formatting).
  4. If your JSON is valid, it will be formatted correctly.
  5. If there’s an error, it won’t format correctly, and you’ll need to check for missing commas, brackets, or incorrect syntax.
Validate JSON Using JSON Viewer Plugin in Notepad++

 

Validate JSON Using JSON Tool Plugin

Another way of doing the same is to use the JSON Tools Plugin for Proper Validation, which is recommended because it offers other features, such as testing.

Also, unlike JSTool, JSON Tools highlights specific errors in JSON files.

How to Install JSON Tools Plugin:

We already have discussed at the beginning of this article how to install a new plugin in Notepad++; however, here is a quick revision.

  1. Open Notepad++ and go to Plugins > Plugins Admin.
  2. Search for “JSON Tools“.
  3. Click Install and restart Notepad++.

How to Validate JSON with JSON Tools:

  1. Open your JSON file in Notepad++.
  2. Go to Plugins > JSON Tools > Check JSON Syntax.
  3. If the JSON is valid, you’ll see a success message.
  4. If the JSON is invalid, an error message will appear, showing where the issue is.
Validate JSON with JSON Tools plugin in NOtepad++

🔴 Common JSON Errors and Fixes:

Error Cause Fix
Unexpected token Extra or missing commas Ensure commas are placed correctly
Unterminated string Missing quotation marks Check that all strings are enclosed in quotes
Mismatched brackets Missing {} or [] Ensure all brackets are correctly opened & closed

Conclusion: Why Use Notepad++ for JSON Formatting?

  • Fast & Lightweight – Unlike bulky IDEs, Notepad++ runs smoothly on any PC.
  • Plugin Support – JSON Viewer & JSTool make formatting easy.
  • Minify & Beautify JSON – Great for both readability and efficiency.
  • Error Detection – Helps debug JSON files quickly.

📌 Frequently Asked Questions (FAQs)

1. Can I format JSON in Notepad++ without a plugin?

No, Notepad++ does not have built-in JSON formatting. You must install a plugin like JSON Viewer or JSTool.

2. What is the best JSON formatter plugin for Notepad++?

JSON Viewer is the easiest and most widely used. However, JSTool provides more advanced features like minifying and validating JSON.

3. How do I fix JSON formatting errors in Notepad++?

Use the Validate JSON option in JSON Viewer to detect and fix errors manually.

 



Source link

Related Posts

About The Author

Add Comment