TutorialsJSON resources
12 min read

How to Format JSON in Notepad++: Quick Setup (2026)

How to Format JSON in Notepad++: Quick Setup (2026)

Install the JSTool plugin in Notepad++, then press Ctrl+Alt+M to format any JSON file. Notepad doesn't format JSON without a plugin. JSTool adds formatting, minification, key sorting, and a JSON tree viewer.

JSTool is an actively maintained JSON plugin available through the official Notepad plugin list. It transforms minified single-line JSON into readable indented text with proper line breaks and spacing. The plugin formats JavaScript and JSON, but it is not a dedicated JSON linter. Formatting alone does not prove that the input is valid JSON.

Installation is straightforward: Open Notepad++, go to Plugins > Plugins Admin, search "JSTool", check it, and click Install. Confirm the restart if prompted. After restart, the plugin works on any JSON file. Open the file and press Ctrl+Alt+M. The plugin also includes JSMin for compact output and JSON Sort for alphabetizing object keys; both are available from Plugins > JSTool, with custom shortcuts available through Shortcut Mapper.

How to Install JSTool in Notepad

Open Notepad. Go to Plugins → Plugins Admin. Wait for the plugin list to load. Type "JSTool" in the search box. Check the box next to JSTool in the results. Click Install and confirm the restart when prompted.

After restart, open any JSON file and press Ctrl+Alt+M. Your JSON formats instantly with proper indentation and line breaks.

If Plugins Admin is missing, update from the official Notepad++ downloads page. A current installation includes Plugins Admin and the plugin list it needs.

Format JSON with JSTool

Open your JSON file or paste JSON into a new tab. Press Ctrl+Alt+M. That's it.

Before formatting:

JSON
{"name":"Alex","age":30,"city":"Portland","hobbies":["reading","cycling","photography"],"address":{"street":"123 Main St","zip":"97201"},"active":true}

After formatting:

JSON
{
  "name": "Alex",
  "age": 30,
  "city": "Portland",
  "hobbies": [
    "reading",
    "cycling",
    "photography"
  ],
  "address": {
    "street": "123 Main St",
    "zip": "97201"
  },
  "active": true
}

The formatted version shows structure at a glance. You can see nested objects, array items, and property relationships without counting brackets.

Quick Comparison: All Formatting Methods

MethodSetup timeWorks offlineHandles large filesKeyboard shortcutBest for
JSTool pluginPlugin installYesDepends on inputCtrl+Alt+MRegular Notepad++ users
JSON Viewer pluginPlugin installYesDepends on inputCtrl+Alt+Shift+JExploring nested structures
Python json.tool0 (if installed)YesMemory-dependentN/A (command line)Batch processing and scripts
Online formatters0NoVariesN/AQuick one-off, no install access
VS CodeApp installYesSubject to editor limitsShift+Alt+FDaily JSON work

Most people who want the documented JSTool workflow should start with JSTool. For a file that is uncomfortable to format in the editor, use Python's json.tool or split it first. For exploring complex nested JSON, JSON Viewer adds a dedicated tree interface.

Other JSTool Commands

JSMin: Removes unnecessary whitespace and newlines. Use Plugins > JSTool > JSMin, then assign a shortcut in Shortcut Mapper if needed.

JSON Sort: Alphabetizes object keys and reformats the document. Use Plugins > JSTool > JSON Sort for the current file or JSON Sort (New file) to preserve the original.

Most of the time you'll only use JSFormat (Ctrl+Alt+M). The other commands are there when you need them.

CommandShortcutWhat it does
JSFormatCtrl+Alt+MFormats minified JSON with indentation and line breaks
JSMinPlugins menu or customRemoves unnecessary formatting for compact output
JSON SortPlugins menu or customAlphabetizes object keys and reformats the JSON

When the Keyboard Shortcut Doesn't Work

The file does not need a .json extension for JSTool's JSFormat command to work on the whole document or selected lines. Notepad will not apply JSON syntax highlighting automatically if the extension or selected language is different.

Go to Language menu → J → JSON. This tells Notepad to treat the file as JSON for syntax highlighting even if the extension is wrong. The setting is helpful, but it is not a prerequisite for JSFormat.

If the shortcut still does nothing, it conflicts with another plugin or system shortcut. Use the menu instead: Plugins → JSTool → JSFormat. Or change the shortcut in Settings → Shortcut Mapper → Plugin commands tab. Find "JSFormat" in the list, double-click it, press your preferred key combination.

Choose an unused combination if you assign an alternative shortcut.

When Formatting Fails Silently

JSTool's JSFormat command is a JavaScript/JSON formatter, not a strict JSON validator. It may leave malformed input unchanged or produce output that still is not valid JSON.

Common JSON syntax errors:

  • Trailing comma: ["item1", "item2",] - remove that last comma
  • Single quotes: {'name': 'value'} - JSON requires double quotes
  • Missing comma: {"a": 1 "b": 2} - needs comma between properties
  • Comments: JSON doesn't allow // or /* */ comments (even though JavaScript does)
  • Unmatched brackets: {"key": ["value"} - brackets and braces must match

For JSON-aware errors inside Notepad++, use JsonTools and run Check JSON syntax now. Fix the reported errors, then format again.

JSON Viewer for Tree Navigation

JSON Viewer adds a tree panel that shows your JSON as expandable nodes and marks the location of parse errors. It is useful for navigating large nested files without scrolling through all the formatted text.

Install it the same way as JSTool: Plugins → Plugins Admin → search "JSON Viewer" → check the box → Install → restart.

After restart, open a JSON file and go to Plugins → JSON Viewer → Show JSON Viewer. A panel appears on the right side. Click folder icons to expand or collapse sections. The search box at the top filters by key name.

When to use JSON Viewer vs JSTool:

FeatureJSToolJSON Viewer
Formats text in placeYesYes
Tree navigationYesYes
Search by key nameSimple viewer searchYes
Edit values directlyYes (in text editor)No
Best forMaking JSON readableExploring large nested files
Keyboard shortcutCtrl+Alt+MCtrl+Alt+Shift+J

Install both only if you prefer JSON Viewer's dedicated panel. Their formatting and tree-navigation features overlap.

Format JSON Without Plugins

Python command line:

Bash
python -m json.tool input.json output.json

This reads input.json, formats it, and saves the result to output.json. The original file stays unchanged. Works on any system with Python installed.

To format and display in terminal without saving:

Bash
python -m json.tool input.json

Online formatters:

  • jsonformatter.org - paste JSON, click Format, copy the result
  • jsonlint.com - formats and validates at the same time, shows error messages

Privacy practices vary between online tools. Keep API keys, passwords, and personal information in a local workflow unless the service's policy and your organization permit uploading them.

VS Code: Open any .json file and press Shift+Alt+F. Formatting is built in, with JSON syntax highlighting and inline error detection.

Formatting Large JSON Files

JSTool does not document a general file-size limit for JSFormat. Formatting behavior depends on the input structure, available memory, and the Notepad process, so avoid relying on an exact threshold.

For large files:

  1. Use a JSON splitter to break the file into smaller chunks first
  2. Format each chunk separately with JSTool
  3. Merge them back if needed

Or format via command line with Python's json.tool module. This avoids the editor UI, but Python still needs enough memory to parse the document:

Bash
python -m json.tool large.json formatted.json

For very large exports, a streaming parser or a purpose-built large-file viewer may be more practical than pretty-printing the entire document.

Formatting API Responses

Copy JSON from your browser's Network tab or from Postman. Open Notepad, create a new file (Ctrl+N). Paste the JSON (Ctrl+V). Set language to JSON (Language → J → JSON). Format with Ctrl+Alt+M.

If you do this constantly, record a macro. Go to Macro → Start Recording. Set language to JSON, then format. Macro → Stop Recording. Macro → Save Current Recorded Macro. Give it a name and assign a keyboard shortcut. Now you can format API responses with one keystroke.

Formatting Config Files with Comments

package.json is strict JSON, while tsconfig.json and some other config formats permit comments. JSTool may format commented text because it is JavaScript-aware, but comments are not valid JSON.

Options:

  • Use JSTool's JavaScript-aware formatter, understanding that the result is not strict JSON
  • Use VS Code or another editor's JSONC mode when the consuming tool supports comments

VS Code recognizes files such as tsconfig.json and can format them with comments intact. The application reading the file still determines whether JSONC is accepted, so do not add comments to a strict JSON file merely because an editor can format them.

Formatting JSON Inside Other Files

Sometimes JSON appears inside JavaScript files, HTML files (JSON-LD schema), or Python files (JSON strings).

To format embedded JSON:

  1. Select just the JSON portion (don't include surrounding code)
  2. Copy it (Ctrl+C)
  3. Open a new tab in Notepad++
  4. Paste (Ctrl+V)
  5. Set language to JSON (Language → J → JSON)
  6. Format with Ctrl+Alt+M
  7. Copy the formatted result back to the original file

This is clunky but works. VS Code's "Format Selection" feature is cleaner for this use case. Select the JSON part, right-click, choose "Format Selection". It formats just the selected text without affecting the rest of the file.

Batch Formatting Multiple JSON Files

Need to format 50 JSON files? Doing them one by one is tedious.

PowerShell script for Windows:

PowerShell
Get-ChildItem *.json | ForEach-Object {
    $formattedPath = "$($_.FullName).formatted"
    python -m json.tool $_.FullName $formattedPath
    if ($LASTEXITCODE -eq 0) {
        Move-Item $formattedPath $_.FullName -Force
    } else {
        Remove-Item $formattedPath -ErrorAction SilentlyContinue
    }
}

Save this as format-all-json.ps1. Back up the folder, open PowerShell there, and run .\format-all-json.ps1. It replaces each valid .json file only after Python formats it successfully.

Bash script for Linux/Mac:

Bash
for file in *.json; do
    python -m json.tool "$file" > temp.json && mv temp.json "$file"
done

These scripts use Python's json.tool instead of JSTool because command-line automation with Notepad++ plugins is complicated.

Formatting Deeply Nested JSON

Formatted text gets hard to read when you have several nesting levels. Objects inside arrays inside objects inside arrays are especially difficult to follow.

Example of deep nesting:

JSON
{
  "user": {
    "profile": {
      "personal": {
        "name": "Alex",
        "contacts": {
          "email": "alex@example.com",
          "phones": [
            {"type": "mobile", "number": "555-0100"},
            {"type": "work", "number": "555-0101"}
          ]
        }
      }
    }
  }
}

Even formatted, this is hard to navigate. Use JSON Viewer's tree panel instead. The tree view is easier to navigate when you have deep nesting. Click to expand the sections you care about, leave the rest collapsed.

Formatting JSON with Huge Arrays

JSON files with thousands of array items, such as data exports, can create navigation problems. JSTool puts array items on separate lines, so a large array can become a much longer file after formatting.

Better options for large arrays:

JSTool is great for typical JSON files. For data-heavy files, a table viewer or script may provide a more useful representation.

Validating JSON Before Formatting

JSTool does not provide a dedicated strict-JSON linter. For syntax checking before formatting, install JsonTools from Plugins Admin.

Plugins → Plugins Admin → search "JSON Tools" → Install → restart.

After installation, open the JSON file and run Plugins > JsonTools > Check JSON syntax now. JsonTools reports syntax problems and lets you inspect their locations. Fix the errors, then format with JSTool.

This two-step process (validate, then format) saves time when working with JSON from unreliable sources.

Changing Indentation from 2 Spaces to 4

JSTool's Options dialog controls its indentation. Open Plugins > JSTool > Options and choose the required number of spaces or tabs.

Set indentation to 4 spaces, confirm the dialog, and run JSFormat again with Ctrl+Alt+M. The formatter applies the new indentation to the document.

If the project uses tabs, select tabs in JSTool's Options instead of converting indentation after formatting.

This is clunky but works if you need consistent indentation across your codebase.

Plugins Menu Grayed Out

If JSTool does not appear after installation, check the Installed and Incompatible tabs in Plugins Admin and verify that you installed the build matching your Notepad architecture.

The Notepad plugin manual notes that installation may require administrator permission when the plugins directory is not writable. Use administrator mode only for the installation when Windows requests it, then reopen Notepad normally.

Frequently Asked Questions

What's the keyboard shortcut to format JSON in Notepad?

Ctrl+Alt+M after installing JSTool. If it doesn't work, use Plugins → JSTool → JSFormat or change the shortcut in Settings → Shortcut Mapper.

Why won't my JSON format?

Check whether JSTool is installed and whether Ctrl+Alt+M conflicts with another command. If the data may be malformed, use JsonTools to check its syntax before formatting.

How do I install the JSON plugin?

Plugins → Plugins Admin → search "JSTool" → check box → Install → restart.

Can Notepad++ validate JSON?

JSTool formats JavaScript and JSON but is not a dedicated strict-JSON validator. Install JsonTools for syntax linting and JSON Schema validation, or use JSON Viewer to locate parse errors.

Can I format JSON without plugins?

Use python -m json.tool input.json output.json or paste into jsonformatter.org. VS Code has built-in formatting (Shift+Alt+F).

What if I have a huge JSON file?

JSTool does not publish a dependable JSFormat size limit. If the editor becomes slow, use Python's json.tool or split the file first with a JSON splitter.

Does JSTool work with JSONC (JSON with comments)?

JSTool's JavaScript-aware formatter can process text containing comments, but the result is not strict JSON. Keep comments only when the application reading the file explicitly supports JSONC or another commented JSON dialect.

Can I change the indentation from 2 spaces to 4?

Open Plugins > JSTool > Options, choose 4 spaces for indentation, and run JSFormat again.

How do I format JSON inside JavaScript files?

Select the JSON part, copy to new tab, set language to JSON, format, copy back. Or use VS Code's "Format Selection" feature.

Can I batch format multiple JSON files?

Use a PowerShell or bash script with Python's json.tool. See the "Batch Formatting Multiple JSON Files" section above for the exact script.

Need to work with JSON in other ways? These tools help:

  1. JSON Merger - Combine multiple JSON files into one
  2. JSON Splitter - Break large JSON files into smaller chunks
  3. JSON to Excel - Convert JSON to spreadsheet format
  4. JSON to Table - View JSON data in table format
  5. JSON Flattener - Flatten nested JSON structures
  6. Best JSON Editors for Windows - Compare 9 JSON editors beyond Notepad++

Read More

All Articles
How to Format JSON in Notepad++: Quick Setup (2026)