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

Install the JSTool plugin in Notepad++, then press Ctrl+Alt+M to format any JSON file instantly. Takes two minutes to set up, works on every JSON file after that. Notepad doesn't format JSON without a plugin. JSTool adds formatting, minification, and key sorting.
JSTool is the most popular JSON plugin for Notepad with over 2 million downloads. It transforms minified single-line JSON into readable indented text with proper line breaks and spacing. The plugin also validates JSON syntax and shows error messages when brackets or commas are misplaced. For developers working with API responses, config files, or data exports in Notepad, JSTool is essential.
Installation takes under two minutes: Open Notepad, go to Plugins > Plugins Admin, search "JSTool", click Install, and Notepad++ restarts automatically. After restart, the plugin works on any JSON file. Open the file, press Ctrl+Alt+M, and JSON formats instantly. The plugin also includes Ctrl+Alt+N for minifying JSON back to single-line format and Ctrl+Alt+S for sorting object keys alphabetically.
How to Install JSTool in Notepad
Open Notepad. Go to Plugins → Plugins Admin. Wait for the plugin list to load (takes a few seconds). Type "JSTool" in the search box. Check the box next to JSTool in the results. Click Install. Notepad++ restarts automatically.
After restart, open any JSON file and press Ctrl+Alt+M. Your JSON formats instantly with proper indentation and line breaks.
If you're on Notepad++ older than version 7.6, you won't see Plugins Admin in the menu. Update to the latest version from notepad-plus-plus.org first. The update is free and preserves your settings.
Format JSON with JSTool
Open your JSON file or paste JSON into a new tab. Press Ctrl+Alt+M. That's it.
Before formatting:
{"name":"Alex","age":30,"city":"Portland","hobbies":["reading","cycling","photography"],"address":{"street":"123 Main St","zip":"97201"},"active":true}
After formatting:
{
"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
| Method | Setup time | Works offline | Handles large files | Keyboard shortcut | Best for |
|---|---|---|---|---|---|
| JSTool plugin | 2 minutes | Yes | Up to 5MB | Ctrl+Alt+M | Regular Notepad++ users |
| JSON Viewer plugin | 2 minutes | Yes | Up to 10MB | None (menu only) | Exploring nested structures |
| Python json.tool | 0 (if installed) | Yes | 100MB+ | N/A (command line) | Batch processing, huge files |
| Online formatters | 0 | No | Varies | N/A | Quick one-off, no install access |
| VS Code | 5 minutes | Yes | 50MB+ | Shift+Alt+F | Daily JSON work |
Most people should install JSTool. It's fast, works offline, and handles typical JSON files without issues. For files over 5MB, use Python's json.tool. For exploring complex nested JSON, add JSON Viewer.
Other JSTool Commands
JSMin (Ctrl+Alt+N) - Removes all whitespace and newlines. Turns formatted JSON back into a single line. Useful when you need compact output for API requests or when pasting into character-limited fields.
Sort JSON (Ctrl+Alt+S) - Alphabetizes all object keys while preserving structure. Keeps Git diffs clean when multiple people edit the same config file. Key order stays consistent instead of changing every time someone saves.
Most of the time you'll only use JSFormat (Ctrl+Alt+M). The other commands are there when you need them.
| Command | Shortcut | What it does |
|---|---|---|
| JSFormat | Ctrl+Alt+M | Formats minified JSON with indentation and line breaks |
| JSMin | Ctrl+Alt+N | Removes all formatting, compresses to single line |
| Sort JSON | Ctrl+Alt+S | Alphabetizes object keys while preserving structure |
When the Keyboard Shortcut Doesn't Work
The file needs a .json extension or Language set to JSON. Notepad won't recognize it as JSON otherwise.
Go to Language menu → J → JSON. This tells Notepad to treat the file as JSON even if the extension is wrong. After setting the language, Ctrl+Alt+M should work.
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.
Good alternative shortcuts: Ctrl+Shift+J, Alt+Shift+F, or F8 (if not already used by something else).
When Formatting Fails Silently
JSTool only formats valid JSON. If your JSON has syntax errors, formatting fails without an error message.
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
Paste your JSON into jsonlint.com to find the exact error line. JSONLint shows the line number and character position where the error occurs. Fix that error, paste back into Notepad++, try formatting again.
JSON Viewer for Tree Navigation
JSON Viewer adds a tree panel that shows your JSON as expandable nodes. Better for navigating huge nested files than scrolling through 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:
| Feature | JSTool | JSON Viewer |
|---|---|---|
| Formats text in place | Yes | No (read-only tree) |
| Tree navigation | No | Yes |
| Search by key name | No | Yes |
| Edit values directly | Yes (in text editor) | No |
| Best for | Making JSON readable | Exploring large nested files |
| Keyboard shortcut | Ctrl+Alt+M | None (menu only) |
Install both if you work with JSON regularly. They don't conflict with each other.
Format JSON Without Plugins
Python command line:
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:
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
Don't paste sensitive data (API keys, passwords, personal information) into online tools. They might log your input. For sensitive JSON, use local tools only.
VS Code: Open any .json file and press Shift+Alt+F. Formatting is built-in, no plugins needed. VS Code is heavier than Notepad (uses more memory and disk space) but better for daily JSON work. Better syntax highlighting, inline error detection, handles larger files more smoothly.
Formatting Large JSON Files
JSTool works fine up to about 5MB. Between 5-10MB, expect slowdowns. Above 10MB, it might crash Notepad.
For large files:
- Use a JSON splitter to break the file into smaller chunks first
- Format each chunk separately with JSTool
- Merge them back if needed
Or format via command line with Python's json.tool module. It handles large files better than JSTool:
python -m json.tool large.json formatted.json
Or switch to VS Code or Sublime Text. Both handle large JSON files more efficiently than Notepad.
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, tsconfig.json, and other config files often have comments. JSTool won't format them because comments aren't valid JSON (even though many tools accept them).
Options:
- Remove comments temporarily, format, add them back
- Use VS Code which handles JSONC (JSON with comments) natively
VS Code recognizes files like package.json and tsconfig.json automatically and formats them with comments intact. Press Shift+Alt+F and it works.
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:
- Select just the JSON portion (don't include surrounding code)
- Copy it (Ctrl+C)
- Open a new tab in Notepad++
- Paste (Ctrl+V)
- Set language to JSON (Language → J → JSON)
- Format with Ctrl+Alt+M
- 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:
Get-ChildItem *.json | ForEach-Object {
python -m json.tool $_.FullName temp.json
Move-Item temp.json $_.FullName -Force
}
Save this as format-all-json.ps1. Open PowerShell in the folder with your JSON files. Run .\format-all-json.ps1. It formats every .json file in the current folder.
Bash script for Linux/Mac:
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 5+ nesting levels. Objects inside arrays inside objects inside arrays.
Example of deep nesting:
{
"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 (like data exports) create problems. JSTool puts each array item on its own line. A 10,000-item array becomes a 10,000-line file that's hard to navigate.
Better options for large arrays:
- JSON to Excel converter - view the data as a spreadsheet
- JSON to table viewer - view in browser with sorting and filtering
- Python script with custom formatting that keeps array items compact
JSTool is great for typical JSON files (under 1000 lines). For data-heavy files, specialized tools work better.
Validating JSON Before Formatting
JSTool fails silently on invalid JSON. To catch errors before formatting, install the JSLint plugin.
Plugins → Plugins Admin → search "JSLint" → Install → restart.
After installation, open your JSON file and go to Plugins → JSLint → Lint Current File. A panel at the bottom shows all syntax errors with line numbers. 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 uses 2-space indentation by default. Some teams prefer 4 spaces or tabs. JSTool doesn't have a setting to change this.
Workaround: Format with JSTool first (Ctrl+Alt+M). Then select all text (Ctrl+A). Go to Edit → Blank Operations → TAB to Space. Choose 4 spaces. This converts the 2-space indentation to 4-space.
Or use Edit → Blank Operations → Space to TAB if your team uses tabs instead of spaces.
This is clunky but works if you need consistent indentation across your codebase.
Plugins Menu Grayed Out
If the Plugins menu exists but all options are grayed out, you're running Notepad without administrator privileges and the plugins folder is in a protected location.
Fix: Right-click the Notepad shortcut → Run as administrator. Or reinstall Notepad to a non-protected folder like C:\Tools\Notepad instead of Program Files.
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?
Either the file isn't recognized as JSON (add .json extension or set Language to JSON), or your JSON has syntax errors. Paste into jsonlint.com to find errors.
How do I install the JSON plugin?
Plugins → Plugins Admin → search "JSTool" → check box → Install → restart.
Can Notepad++ validate JSON?
JSTool validates during formatting but fails silently. For detailed error messages, use jsonlint.com or install the JSLint plugin.
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 handles up to 5MB fine. Above that, use Python's json.tool or split the file first with a JSON splitter.
Does JSTool work with JSONC (JSON with comments)?
No. Remove comments, format, then add them back. Or use VS Code which supports JSONC natively.
Can I change the indentation from 2 spaces to 4?
Format first, then Edit → Blank Operations → TAB to Space and choose 4 spaces. JSTool doesn't have an indentation setting.
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.
Related Tools
Need to work with JSON in other ways? These tools help:
- JSON Merger - Combine multiple JSON files into one
- JSON Splitter - Break large JSON files into smaller chunks
- JSON to Excel - Convert JSON to spreadsheet format
- JSON to Table - View JSON data in table format
- JSON Flattener - Flatten nested JSON structures
- Best JSON Editors for Windows - Compare 9 JSON editors beyond Notepad++
Read More
All Articles
How to Add Image in JSON: 3 Easy Methods (2026)
Add images to JSON using URLs, base64 encoding, or file paths. Complete guide with code examples, size optimization tips, and best practices for each method in web and mobile apps.

How to Merge GPX Files: Free Tools & Methods (2026)
Merge multiple GPX files into one using free online tool, Python, or GPSBabel. Complete guide for combining GPS tracks, waypoints, and routes from Garmin, Strava, Komoot, and other devices.

How to Merge VCF Files: Free Tool & Guide (2026)
Merge multiple VCF (vCard) contact files with free online tool, Python, or command line. Includes duplicate removal, contact sorting, and migration between iPhone, Android, Google, and Outlook.