Sort JSON in VS Code, IntelliJ, Notepad++, WebStorm — Or Skip the Plugin Entirely
- Every major editor has a plugin or command to sort JSON keys — but all require install and configuration.
- Browser tool is faster for one-off sorting, no install, works across every editor.
- Covers VS Code, IntelliJ/WebStorm/PyCharm/Rider, Notepad++, Sublime Text, Zed.
Table of Contents
You can sort JSON keys in just about every editor — VS Code, IntelliJ IDEA, WebStorm, PyCharm, Rider, Notepad++, Sublime Text, Zed. The gotcha is that each one requires either a plugin install or a specific command, and the config varies. If you are on a new machine, SSHing into a server, or pair-programming on a colleague's laptop, none of those plugins are there.
Our JSON Key Sorter works in any browser, on any machine, with zero setup. This post covers how to sort in each major editor and when the browser is the better choice.
VS Code — Extensions and Built-In Commands
VS Code does not have a built-in "sort JSON keys" command. You have three options:
1. Extension: "Sort JSON objects" — the most popular choice. Install from the marketplace, then use Command Palette (Ctrl+Shift+P) → "Sort JSON". Works in-place, supports recursion.
2. Extension: "Prettier - Code formatter" with sort plugin — install Prettier plus prettier-plugin-sort-json. Configure in your .prettierrc. Sorts on save if you enable format-on-save. Best for teams who want consistent sorting enforced in the editor and CI.
3. Selection + TypeScript compiler trick — paste your JSON into a .ts file, use TypeScript's quick fix to "sort object properties." Works without extensions but clunky.
When the browser beats VS Code: fresh machine setups, SSH sessions without your extensions, quick sorts where opening VS Code is slower than pasting into a browser tab already open.
IntelliJ, WebStorm, PyCharm, Rider — Same Pattern
JetBrains IDEs all share the same JSON plugin (bundled by default). To sort keys:
1. Open the JSON file.
2. Code → Rearrange Code, or Ctrl+Alt+Shift+L → Reformat with "Rearrange entries" checked.
3. Configure the rearranger: Settings → Editor → Code Style → JSON → Arrangement. Set "Keys" to alphabetical.
WebStorm and PyCharm support this the same way. IntelliJ Ultimate adds more options for mixed JSON + YAML + TypeScript workflows. Rider (.NET) includes it for appsettings.json sorting.
Downsides: configuration is file-type global, not per-project. If you want different sort rules for different JSON files (e.g., sorted package.json but preserve-order for API fixtures), you cannot easily do that in settings.
Browser advantage: one-off sorts without touching global settings. Also easier to show someone else the result — send a link, not a screenshot of your IDE.
Notepad++ — JSONSort Plugin
Notepad++ has a plugin called "JSONSort" available through Plugin Admin (Plugins → Plugins Admin → search "JSONSort" → Install).
Once installed: Plugins → JSONSort → Sort JSON. The plugin sorts the current document in place. It handles nested sorting but lacks toggles for direction (A-Z only) and cannot sort a selection — it always processes the whole file.
For Notepad++ users on Windows, this plugin is the standard. It works offline and does not require any internet connection. However, if you edit JSON rarely in Notepad++, installing a plugin is friction you can avoid with the browser tool.
One more Notepad++ option: the Python Script plugin, which lets you run a custom Python script including json.dumps(sort_keys=True). Overkill unless you already use the Python Script plugin for other automations.
Sublime Text, Zed, and Vim
Sublime Text: Install "Pretty JSON" from Package Control, then use Command Palette → "Pretty JSON: Sort keys." Fast and reliable.
Zed: As of early 2026, no built-in JSON sort command. Use Zed's format command with an external formatter that sorts, or drop to the browser tool.
Vim/Neovim: Pipe through jq: :%!jq --sort-keys . sorts the entire buffer. Requires jq installed on the system. For Neovim users, the plugin vim-json-sort wraps this with a command.
Emacs: json-mode does not sort by default. Use json-pretty-print-buffer with a custom advice function, or pipe through jq via shell-command-on-region.
Every editor has an answer, but none as fast as paste-and-click in a browser tool you already have open.
Sort-on-Save Setup (VS Code + Prettier Example)
If you want sorting to happen automatically whenever you save a JSON file, you need the Prettier route with a JSON sort plugin. Here is the setup in VS Code:
1. Install extension: Prettier - Code formatter (esbenp.prettier-vscode).
2. Install plugin locally: npm install -D prettier prettier-plugin-sort-json.
3. Add .prettierrc:
{
"plugins": ["prettier-plugin-sort-json"],
"jsonRecursiveSort": true
}
4. Enable format-on-save: settings.json → "editor.formatOnSave": true and "[json]": {"editor.defaultFormatter": "esbenp.prettier-vscode"}.
Now every JSON save alphabetizes keys automatically. Combine with a pre-commit hook (husky + lint-staged) for team-wide enforcement.
This is the right setup when sorted JSON is a team convention. For individual one-offs, the browser tool remains faster.
Decision: Editor vs Browser
Use the editor when: editing an existing file you will save back, working in a repo with sort-on-save enforced, or when the file is too large to paste into a browser (tens of MB+).
Use the browser when: the JSON is on your clipboard or in a random paste buffer, you are on a fresh or unfamiliar machine, you need to share the result quickly, or the JSON came from a network response and you just want to read it.
Both have their place. The browser tool is the "always works anywhere" fallback.
Sort JSON Without Installing a Plugin
Works in any browser, no extension, no setup. Just paste and sort.
Open Free JSON Key SorterFrequently Asked Questions
Does VS Code sort JSON keys out of the box?
No. VS Code has no built-in JSON sort command. You need either the "Sort JSON objects" extension or Prettier with a sort plugin. Both work well; the extension is faster to install, Prettier is better for teams.
Can IntelliJ sort JSON keys automatically on save?
Yes, via "Actions on Save" in Settings. Check "Reformat code" and configure the JSON code style to use alphabetical key arrangement. Apply on save happens automatically after that.
What is the jq command to sort JSON keys?
jq --sort-keys . input.json or inside an editor, pipe the buffer through jq with this flag. It recursively sorts at every level, which matches our browser tool default.
Does Prettier sort JSON keys by default?
No. Prettier formats and pretty-prints but preserves key order by default. Install prettier-plugin-sort-json and enable jsonRecursiveSort in your .prettierrc to get automatic alphabetical sorting.

