How do I format JSON in Notepad++?

Dark navy cover card with the title 'How do I format JSON in Notepad++?' in white and a green accent bar

To format JSON in Notepad++, install a JSON plugin first, because Notepad++ has no JSON formatter of its own. Open Plugins > Plugins Admin, install JSON Viewer or JsonTools, and let Notepad++ restart. Then press Ctrl+Alt+Shift+M (JSON Viewer's Format JSON) or Ctrl+Alt+Shift+P (JsonTools' Pretty-print current JSON file).

Does Notepad++ format JSON without a plugin?

Notepad++ does not format JSON without a plugin. It colors JSON syntax and stops there. When a user on Notepad++ 8.4.7 asked why Ctrl+Alt+Shift+M had stopped working, a reply on the Notepad++ Community forum pointed out that Notepad++ doesn't map those keys itself. A plugin does. Remove the plugin and the shortcut goes with it.

How to install a JSON plugin with Plugins Admin

Plugins Admin is the built-in plugin installer, and the Notepad++ user manual describes the steps:

  1. Open Plugins > Plugins Admin.
  2. Stay on the Available tab and search for "JSON Viewer" or "JsonTools".
  3. Tick the check box next to the plugin. Clicking only the name shows its details but doesn't enable the Install button.
  4. Click Install. Notepad++ restarts and the plugin appears under the Plugins menu.

If the install fails, check permissions. The manual says that without write access to the Notepad++ folder you may need to re-run Notepad++ with Windows' Run as Administrator first.

Format JSON in Notepad++ with JSON Viewer

JSON Viewer formats the JSON you select and can also show it as a collapsible tree. Its GitHub page says it displays JSON as a Treeview and highlights the error position when parsing fails.

  1. Select the JSON (Ctrl+A for the whole file).
  2. Choose Plugins > JSON Viewer > Format JSON, or press Ctrl+Alt+Shift+M, as this plugin walkthrough shows.
  3. For the tree, use Show JSON Viewer (Ctrl+Alt+Shift+J).

Take a one-line response like {"user":{"id":7,"roles":["admin","dev"]},"ok":true}. After Format JSON, each key gets its own line, roles gets one line per item, and you can see where user ends.

Version 2.0.2.0 added a settings dialog with options for indentation, line ending and line format. It can also make the parser ignore trailing commas and comments. Version 2.0.8.0 added "Sort ascending by key". One catch from its docs: it doesn't support multi-selection, so select a single block of text.

Format JSON with JsonTools

JsonTools is the heavier option: a formatter plus linting, querying, a tree view and CSV conversion, according to its GitHub page. It works on the whole file, so you don't need to select anything first.

The JsonTools documentation lists these default shortcuts:

Command Shortcut
Pretty-print current JSON file Ctrl+Alt+Shift+P
Compress current JSON file Ctrl+Alt+Shift+C
Open JSON tree viewer Ctrl+Alt+Shift+J

indent_pretty_print defaults to 4. Set it to 2 in the JsonTools settings if your project uses two-space JSON. Comments survive pretty-printing only when remember_comments is set to true.

JsonTools also reads files that strict JSON parsers reject. It parses JSON Lines, the full JSON5 specification and Python-style comments, and it can validate against a JSON schema.

JSON Viewer vs JsonTools vs JSTool

The three plugins most guides mention differ mainly in scope. Each row comes from the project's own page or docs:

JSON Viewer JsonTools JSTool
Format shortcut Ctrl+Alt+Shift+M Ctrl+Alt+Shift+P Ctrl+Alt+M
Works on The selection The whole file The file
Tree view Yes Yes No
Minify Not listed Yes (Ctrl+Alt+Shift+C) Not covered here
JSON5, JSON Lines Can ignore trailing commas and comments Yes, both Not covered here
Also formats JavaScript No No Yes

JSTool runs from Plugins > JSTool > JSFormat and formats JavaScript and JSON with the same command, per this Notepad++ guide. The same guide reports it was deprecated in November 2025, so older installs still work but won't get updates.

My take: install JsonTools. Pick JSON Viewer only if all you ever do is reformat a pasted snippet. JsonTools formats the whole file without a selection, also compresses, and parses JSON5 and JSON Lines, where JSON Viewer can at best ignore trailing commas and comments.

Why the Notepad++ shortcut does nothing

When the format shortcut does nothing, the plugin is usually not loaded, or two plugins want the same keys. Check in this order:

  • The plugin isn't installed or didn't load. Look under the Plugins menu. If there's no JSON Viewer or JsonTools entry, reinstall it from Plugins Admin.
  • Two plugins claim Ctrl+Alt+Shift+J. Both JSON Viewer and JsonTools use it for their tree views. Keep one plugin, or remap a key under Settings > Shortcut mapper > Plugin commands.
  • Nothing is selected. JSON Viewer works on the selection, so press Ctrl+A first.
  • The JSON is broken. A missing quote or bracket stops formatting. JSON Viewer marks the error position; fix that spot and run the command again. If the error is about a truncated file, Unexpected end of JSON input explains what's missing.

Limits to know before you format a big file

Neither plugin is built for very large files. The JsonTools page warns that it may consume huge amounts of memory on really huge JSON files, and gives 50+ megabytes as an example. It also caps integers at 64 bits and converts larger ones to floating point, which can change the digits: the same trap as in JSON.parse and large numbers. If your file holds long IDs, check them after formatting.

For a file too big for an editor, see how to open a JSON file. On a machine where you can't install plugins, the JSON formatter on this site formats in the browser with a 2-space indent, and its tool code makes no network requests. If you also edit JSON in VS Code, formatting JSON in VS Code needs no plugin at all.

FAQ

Does Notepad++ have a built-in JSON formatter?

No. Notepad++ highlights JSON, but formatting comes from a plugin such as JSON Viewer or JsonTools. A reply on the Notepad++ Community forum notes that Notepad++ doesn't map the usual JSON shortcuts itself.

What is the shortcut to format JSON in Notepad++?

With the JSON Viewer plugin it's Ctrl+Alt+Shift+M (Plugins > JSON Viewer > Format JSON). With JsonTools it's Ctrl+Alt+Shift+P for Pretty-print current JSON file.

Why is Plugins Admin not installing the JSON plugin?

Tick the check box next to the plugin name before clicking Install. If you can't write to the Notepad++ program folder, restart Notepad++ with Run as Administrator and try again.

How do I minify JSON in Notepad++?

JsonTools has a Compress current JSON file command on Ctrl+Alt+Shift+C that strips the unnecessary whitespace.

Sources