I highlight the code and run Command Option L (a short-cut for the Code->Reformat Code menu).

On Windows use Ctrl Alt L.

Note that this only works if the code is well-formed JSON (clear any red squiggles).

Answer from Jason D on Stack Overflow
🌐
Medium
elvisciotti.medium.com › formatting-a-string-as-json-in-intellij-java-064e0ed2f15e
Formatting a JSON string or convert case in IntelliJ (short) - Elvis Ciotti - Medium
August 28, 2024 - In the conversion options, select “JSON” as the output format. The formatted JSON will be displayed in the preview window. You can then copy it or replace the original string. ... Right-click, then “String converter”. You can use the shortcuts instead of right click.
🌐
JetBrains
jetbrains.com › help › idea › json.html
JSON | IntelliJ IDEA Documentation
February 10, 2026 - In the File Name Patterns area, click and type *.json in the Add Wildcard dialog that opens. IntelliJ IDEA can automatically download and use schemas from the JSON Schema Store that hosts schema files for many popular configuration files. As soon as you open a file whose name is associated with one of the available schemas (for example, tsconfig.json), IntelliJ IDEA downloads and uses this schema for it.
🌐
JetBrains
jetbrains.com › help › idea › settings-code-style-json.html
Code Style. JSON | IntelliJ IDEA Documentation
October 8, 2024 - Use this page to configure formatting options for JSON files. When you change these settings, the Preview pane shows how this will affect your code. Use this tab to specify where you want IntelliJ IDEA to insert spaces automatically.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 7179247589906-IntelliJ-reformat-for-JSON-files-stoped-working
IntelliJ reformat for JSON files stoped working. – IDEs Support (IntelliJ Platform) | JetBrains
August 16, 2022 - Hello, previously I was able to format json file to make it look pretty and well-formatted but for some reason reformat (shortcut ⌘⌥L) for json files doesn't work anymore. Does anybody know what co...
🌐
JetBrains
plugins.jetbrains.com › plugin › 13931-json-formatter
Json Formatter - IntelliJ IDEs Plugin | Marketplace
JetBrains IDE/Android Studio JSON Formatter Plugin Format, Minify, Verify JSON as if you edit a file with .json suffix.
🌐
GitHub
gist.github.com › jigi-33 › a887d272a9eb37bc4d2ad9ddf2ac7d27
[trick] JSON pretty formatting in PyCharm and other IntelliJ IDEA products · GitHub
[trick] JSON pretty formatting in PyCharm and other IntelliJ IDEA products - pycharm_json_formatting_feature.MD
🌐
DEV Community
dev.to › scottshipp › prettify-json-with-intellij-scratch-files-pna
Prettify JSON with IntelliJ scratch files! - DEV Community
November 8, 2021 - Choose "JSON" (hint: you can type "json"). ... Go to Code > Reformat code or use the shortcut key Alt + Option + L. Note: The above shortcut keys are for macOS. Review the IntelliJ Keymap reference for the corresponding shortcuts in your operating ...
Find elsewhere
🌐
Xebia
xebia.com › home › blog › json formatter plugin for intellij
JSON Formatter Plugin For IntelliJ | Xebia
February 5, 2009 - Not because it's so complicated, but because it has been optimized for network communication, which in this case, means: all the whitespace has been stripped. Wouldn't it be nice to have an integrated JSON formatter in your IDE to handle this? Well, now it possible! What I did was to create a plugin for IntelliJ, to format your JSON code into some more readable (and formatted) code.
🌐
CodingTechRoom
codingtechroom.com › question › format-json-strings-intellij-idea
How to Format JSON Strings in IntelliJ IDEA? - CodingTechRoom
Use the built-in JSON formatter by selecting the JSON string and using the shortcut `Ctrl + Alt + L` (Windows/Linux) or `Cmd + Option + L` (Mac). If you have a JSON file, right-click the file in the project explorer and select 'Reformat Code'. Install a plugin if necessary, such as 'JSON Viewer', ...
🌐
JetBrains
plugins.jetbrains.com › plugin › 14149-json-viewer
Json Viewer - IntelliJ IDEs Plugin | Marketplace
Transform Json strings into a human-readable format. Format with `Alt+F` or click "Format". Search in json with your search key (e.g. `Cltr+F`).
🌐
JetBrains
youtrack.jetbrains.com › issue › IJPL-65599 › Add-ability-to-compact-json-files-by-ctrl-alt-L-double-press
Add ability to compact json files by ctrl + alt + L double press
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 206354469-Format-Prettify-Json
Format/Prettify Json – IDEs Support (IntelliJ Platform) | JetBrains
January 6, 2026 - I have a file that contains generated JSON, e.g. a JavaScript source-map. The file does not contain any line breaks. How do I quickly reformat this file in Webstorm to make it humanly readable, adding line-breaks in a reasonable way. My JavaScript code-style settings don't touch (force) line breaks, and I don't want to change that. Any ideas? Thx ... Create 2 different code styles and switch between them? Ctrl+` (or whatever shortcut you may have there for "View | Quick Switch Scheme...")
🌐
Automationrhapsody
automationrhapsody.com › intellij-idea-tostring-templates-for-json-output
IntelliJ IDEA toString templates for JSON output
August 16, 2022 - Generate toString() window is opened either by right click on the object you want to generate toString() for and selecting Generate from the menu, or by keyboard combination Alt + Insert.
🌐
JetBrains
plugins.jetbrains.com › plugin › 16658-view-as-json
View as JSON - IntelliJ IDEs Plugin | Marketplace
What is it for? Using this IntelliJ plugin, you can: Prettify your JSON string and view colored formatHighlight bracket pairs as you move through linesScroll through...
🌐
JetBrains
plugins.jetbrains.com › plugin › 23776-pretty-json
Pretty JSON - IntelliJ IDEs Plugin | Marketplace
This is a json formatting plugin 1. Plugin Center Download `Pretty JSON` plugin 2.1 Choose data -> right Click Menu `Pretty JSON` Or Use a Shortcut Key `Command...
🌐
GitHub
github.com › chocolate213 › json-formatter
GitHub - chocolate213/json-formatter: Json formatter plugin
Paste JSON string into the editor, and press Reformat Code (Ctrl + Alt + L in windows) to format code as if you edit a file with .json suffix.
Starred by 7 users
Forked by 2 users
Languages   Java 100.0% | Java 100.0%
🌐
Medium
erpsolutionsoodles.medium.com › why-do-we-use-json-format-with-intellij-1f177eca840f
Why Do We Use JSON Format With IntelliJ | by ERP Solutions oodles | Medium
August 24, 2023 - Click + in the File Name Patterns section, and in the Add Wildcard dialogue that appears, type *.json. ... For several well-known configuration files, IntelliJ Idea may automatically download and use schemas from the JSON Schema and save those host’s schema documents.
🌐
JetBrains
jetbrains.com › help › idea › reformat-and-rearrange-code.html
Reformat code | IntelliJ IDEA Documentation
January 6, 2026 - Reformat your code (Ctrl+Alt+L). IntelliJ IDEA will reformat your code in accordance with the current style settings, keeping existing formatting for the rules which you've selected.