Need help with your JSON?
Try our JSON Formatter tool to automatically identify and fix syntax errors in your JSON. JSON Formatter tool
Keyboard Shortcuts for Efficient JSON Formatting
If you are looking for a single universal shortcut to format JSON, the first thing to know is that there isn't one. The fastest key combination depends on where you are working: VS Code, a JetBrains IDE, or a browser-based formatter all behave differently.
That distinction matters because a lot of shortcut lists on the web are wrong. They mix editor commands, browser commands, and made-up formatter hotkeys. For real productivity, learn one reliable formatting shortcut for your main editor, then add a small set of search and navigation shortcuts around it.
Quick answer
In current official docs, VS Code formats JSON with Shift+Alt+F on Windows, Shift+Option+F on macOS, and Ctrl+Shift+I on Linux. JetBrains IDEs use Ctrl+Alt+L on Windows and Linux, and Command+Option+L on macOS. In browser-based JSON formatters, there is usually no universal default format shortcut, so the fastest keyboard workflow is tabbing to the Format button and triggering it with Enter or Space.
Quick Reference
| Where You Work With JSON | Formatting Shortcut | Also Worth Memorizing | Important Caveat |
|---|---|---|---|
| VS Code | Shift+Alt+F / Shift+Option+F / Ctrl+Shift+I | Ctrl/Cmd+Shift+O, Ctrl/Cmd+F | Shown according to your keyboard layout and keymap |
| JetBrains IDEs | Ctrl+Alt+L / Command+Option+L | Ctrl/Cmd+Shift+A, Shift twice | OS or window-manager conflicts are common on Linux and macOS |
| Browser-based JSON formatters | No standard default | Tab, Enter, Space, Ctrl/Cmd+F | The site has to expose keyboard-focusable controls |
A Fast Keyboard Workflow for Browser-Based JSON Formatters
On the web, keyboard efficiency usually comes from standard editing and navigation shortcuts, not from a built-in JSON-specific hotkey. That is especially true when you are using an online formatter for quick, one-off cleanup.
- Paste the payload with Ctrl+V or Command+V.
- Use Tab or Shift+Tab to move focus to the Format, Validate, or Minify controls.
- Activate the focused button with Enter or Space.
- Search the formatted output with Ctrl+F or Command+F.
- Select everything with Ctrl+A or Command+A, then copy with Ctrl+C or Command+C.
Practical takeaway
If your browser-based formatter does not advertise a dedicated format hotkey, do not assume that Ctrl/Cmd+Shift+F will work. In web apps, that kind of shortcut is often intercepted by the browser or reserved for a completely different action.
For fast one-off cleanup, use the Offline Tools JSON Formatter with the keyboard-first flow above instead of hunting through menus.
Current VS Code JSON Shortcuts
VS Code is one of the most common places people format JSON, so it is worth memorizing the defaults that are actually documented today. These are especially useful when you jump between API responses, config files, and large sample payloads.
| Action | Windows | macOS | Linux | Why It Helps With JSON |
|---|---|---|---|---|
| Format Document | Shift+Alt+F | Shift+Option+F | Ctrl+Shift+I | Beautifies minified JSON instantly |
| Go to Symbol in Editor | Ctrl+Shift+O | Command+Shift+O | Ctrl+Shift+O | Jump to top-level keys in large objects |
| Trigger Suggestions | Ctrl+Space | Control+Space | Ctrl+Space | Useful when schema-backed completion is available |
| Open Keyboard Shortcuts | Ctrl+K Ctrl+S | Command+K Command+S | Ctrl+K Ctrl+S | Lets you bind a shortcut that matches your workflow |
If you format JSON constantly, a custom binding is often better than memorizing a generic list from the web. In VS Code, you can target JSON files only and avoid changing shortcuts for every language.
Example VS Code binding for JSON only
Add a custom keybinding for editor.action.formatDocument if you want a single shortcut that only fires when a JSON editor is focused:
{
"key": "ctrl+alt+j",
"command": "editor.action.formatDocument",
"when": "editorTextFocus && editorLangId == 'json'"
}If you frequently edit VS Code settings or other JSON-with-comments files, use jsonc instead of json.
JetBrains IDE Shortcuts for JSON
WebStorm, IntelliJ IDEA, and other JetBrains IDEs use a consistent formatting flow. The core shortcut is easy to remember, and the action search tools make it faster to recover when you forget a binding.
| Action | Windows and Linux | macOS | Why It Helps With JSON |
|---|---|---|---|
| Reformat Code | Ctrl+Alt+L | Command+Option+L | Formats the current JSON file or selection |
| Find Action | Ctrl+Shift+A | Command+Shift+A | Search for formatting and validation commands by name |
| Search Everywhere | Shift twice | Shift twice | Fast way to jump to files, actions, and settings |
JetBrains also supports formatting on save through Actions on Save. If you touch JSON files all day, that can be more efficient than pressing the reformat shortcut manually every time.
Conflict warning
On some Linux desktops and macOS setups, default JetBrains shortcuts can conflict with system or input-method shortcuts. If Ctrl+Alt+L or Ctrl/Control+Space does nothing, open the keymap settings and rebind it instead of fighting the OS.
What Usually Breaks JSON Formatting Shortcuts
| Problem | What Is Usually Happening | Best Fix |
|---|---|---|
| Nothing happens when you press the shortcut | The editor is not focused, or the browser/OS captured the keys first | Click into the editor, then test again or rebind the command |
| The file does not format cleanly | The payload is invalid JSON, or you are working with JSONC rather than strict JSON | Validate first, then remove comments or trailing commas if strict JSON is required |
| The displayed shortcut does not match what you expected | Modern editors render shortcuts according to keyboard layout and active keymap | Check the in-app keyboard shortcut editor instead of relying on a cheat sheet |
| A browser-based formatter has no hotkey for Format | Many web tools expose the command only as a button | Use Tab plus Enter, or create a custom browser shortcut with an extension or userscript |
The Small Shortcut Set That Delivers the Biggest Gain
- Memorize one format shortcut for your main editor.
- Memorize one find shortcut so you can inspect large payloads quickly.
- Memorize one action search shortcut such as VS Code's shortcut editor or JetBrains Find Action for everything else.
- In browser tools, rely on Tab, Enter, and Ctrl/Cmd+F before you rely on any site-specific hotkey list.
Bottom Line
Efficient JSON formatting is less about memorizing a giant table and more about using the right shortcut in the right environment. VS Code and JetBrains both give you dependable formatting defaults today, while browser-based formatters reward a simpler keyboard workflow built around focus, search, and copy.
Shortcut examples in this guide were checked against the current official VS Code JSON documentation, the VS Code keybindings documentation, and current JetBrains reformatting guidance.
Need help with your JSON?
Try our JSON Formatter tool to automatically identify and fix syntax errors in your JSON. JSON Formatter tool