The formatting shortcuts in Intellij IDEA are :

  • For Windows : Ctrl + Alt + L
  • For Ubuntu : Ctrl + Alt + Windows + L
  • For Mac : ⌥ (Option) + ⌘ (Command) + L
Answer from axelrod on Stack Overflow
🌐
JetBrains
jetbrains.com › help › idea › reformat-and-rearrange-code.html
Reformat code | IntelliJ IDEA Documentation
4 weeks ago - 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.
🌐
JetBrains
blog.jetbrains.com › home › intellij idea › how to format java code
How to Format Java Code - The JetBrains Blog
June 6, 2024 - We could use Find Action (Shift+Ctrl+A or ⇧⌘A) again to rearrange the file, or reformat the file and tick the rearrange code option. But we can also use Search Everywhere (Shift+Shift or ⇧⇧) and type “rearrange”. Once we’ve called ...
Discussions

Intellij finally has a built in "Reformat code and organize imports" save action in 2021.2

It automatically saves, so usually I just use the reformat code shortcut (rather than using save and have auto format in other IDEs)

More on reddit.com
🌐 r/IntelliJIDEA
4
16
July 28, 2021
java - Intellij IDEA, format all code in a project - Stack Overflow
Anyway I found a way using the file breadcrumb to reformat code in IntelliJ starting in an arbitrary folder and traversing through all subdirectories: gifyu.com/image/JufU Given that all 50+ modules reside in the same parent directory you can reformat all modules at once. More on stackoverflow.com
🌐 stackoverflow.com
Making auto format line up with IntelliJ formatting?
I assume you're talking about the Java formatter here. The Java extension uses Eclipse libraries, so the formatter is configured using Eclipse formatter preferences (a list of available formatter preferences can be found here ). Since Eclipse formatter preferences are not the same as IntelliJ formatter preferences, you'd have to configure each rule manually until it matches what you want (if you want a GUI, you'll need to edit the preferences in the Eclipse IDE). The alternative would be some kind of automatic conversion tool. Eclipse formatter preferences can be converted to IntelliJ preferences, but not vice versa . Another option would be to use some established formatter options that are already available in both the Eclipse and IntelliJ format, such as Google Java Style Guide . More on reddit.com
🌐 r/vscode
6
1
November 2, 2021
"Reformat Code" can not be called via the shortcut "⌘⌥L"
Review its shortcut in settings. More on reddit.com
🌐 r/Jetbrains
5
6
November 21, 2024
🌐
JetBrains
jetbrains.com › guide › java › tutorials › reading-code › formatting
Formatting - JetBrains Guide
March 1, 2024 - In the file you want to reformat, use the shortcut ⌘⌥L (macOS) / Ctrl+Alt+L (Windows/Linux). We can restructure the code by moving code blocks around to match our mental model, preferred style or coding conventions.
🌐
JetBrains
jetbrains.com › guide › tips › reformat-code-or-file
Reformat Your Code - JetBrains Guide
June 12, 2024 - Lastly, there are additional settings you can use for reformatting your code which you can access by invoking the "Reformat Code Dialog" ⌘⌥⇧L (macOS) / Ctrl+Alt+Shift+L (Windows/Linux). The options here will vary depending on which type of code you're working with so try it out and see what you can learn! Want to learn more? Check out the in depth reformatting tutorial for IntelliJ IDEA ·
🌐
JetBrains
jetbrains.com › guide › java › tutorials › reformatting-code
Reformatting Code in IntelliJ IDEA. - JetBrains Guide
February 17, 2023 - How to reformat code directory by directory. ... What is a .editorconfig file and how can you use it in IntelliJ IDEA.
🌐
JetBrains
jetbrains.com › guide › java › tutorials › reformatting-code › reformatting-only-code-youve-changed
Reformatting code you've changed - JetBrains Guide
February 17, 2023 - In this instance, you would ideally like to highlight the code you’ve changed and just reformat that, but that won’t work when your changes are scattered throughout the file. In this instance, you can use ⌘⌥⇧L (macOS) / Ctrl+Alt+Shift+L (Windows/Linux) to bring up the reformatting options dialog: In this dialog, select Only changes uncommitted to VCS. When you press Run, IntelliJ IDEA will reformat the lines in the file that you've changed and nothing else.
Find elsewhere
🌐
JetBrains
jetbrains.com › guide › java › tutorials › reformatting-code › reformatting-a-selection-or-class
Reformatting a selection of code or class - JetBrains Guide
February 17, 2023 - You can use ⌘⌥L (macOS) / Ctrl+Alt+L (Windows/Linux) to reformat a selection of code according to your reformat settings.
🌐
Medium
hirosht.medium.com › automatically-reformat-code-on-save-in-intellij-ddf7842801e0
Automatically reformat code on save in IntelliJ - Hirosh Tharaka - Medium
July 12, 2023 - Automatically reformat code on save in IntelliJ Configure the IDE to reformat code in modified files automatically when your changes are saved. Press Ctrl+Alt+S to open the IDE settings select Tools …
🌐
JetBrains
jetbrains.com › help › idea › code-style.html
Code style and formatting | IntelliJ IDEA Documentation
February 11, 2024 - This allows you to follow multiple code style standards at the same time. For more information, refer to EditorConfig. Once the rules are configured, you can invoke the Reformat code action that changes the formatting of your code in the selected code fragment, within a file, or across your entire project.
🌐
Reddit
reddit.com › r/intellijidea › intellij finally has a built in "reformat code and organize imports" save action in 2021.2
r/IntelliJIDEA on Reddit: Intellij finally has a built in "Reformat code and organize imports" save action in 2021.2
July 28, 2021 -

Intellij finally implemented a feature that other IDEs had for years. You can now finally set up Intellij to automatically reformat your code and organize your imports on each save. There is no more need to either download the "Save Actions plugin" or to write your own macro to execute these two commands on each save. It was about effin' time.

🌐
Medium
medium.com › @AlexanderObregon › intellij-ideas-code-style-features-creating-consistent-and-clean-code-bd1c32df8285
IntelliJ IDEA: Clean & Consistent Code | Medium
April 29, 2024 - Proper indentation, spacing, and alignment make the code easier to read. IntelliJ IDEA provides strong support for code formatting. Use Ctrl + Alt + L (Windows/Linux) or Cmd + Option + L (Mac) to reformat the current file or selected code.
🌐
JetBrains
jetbrains.com › guide › java › tutorials › getting-started-intellij-idea › changing-code
Changing code - JetBrains Guide
February 17, 2023 - To reformat a file or selection of code: Use ⌘⌥L (macOS) / Ctrl+Alt+L (Windows/Linux) to reformat a file or selection of code according to the settings you have defined in your project.
🌐
JetBrains
jetbrains.com › guide › java › tutorials › reformatting-code › introduction
Introduction - JetBrains Guide
February 17, 2023 - For example, if you press ⏎ (macOS) ... shortcuts like ⌥⏎ (macOS) / Alt+Enter (Windows/Linux) to move to the next line, or use code generation. IntelliJ IDEA will also reformat code that you paste into the IDE according to your code style ...
🌐
YouTube
youtube.com › watch
How to format code in Intellij - YouTube
how to format java code in intellijHow to format code in Intellij#intellij #intellijidea
Published: May 9, 2025
🌐
EDUCBA
educba.com › home › software development › software development tutorials › software development basics › intellij format code
IntelliJ Format Code | How to Create IntelliJ Formatting Code?
February 17, 2023 - If we want to reformat the code, use Ctrl+Alt+L; for Ubuntu, we can use Ctrl+Alt+Windows+L. In this article, we are trying to explore the Intellij format code. In this article, we saw the basic ideas of the Intellij format code as well as the ...
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
JetBrains
jetbrains.com › guide › java › tutorials › reformatting-code › reformatting-code-settings
Reformatting Code Settings - JetBrains Guide
February 17, 2023 - You can view the settings for code formatting with ⌘, (macOS) / Ctrl+Alt+S (Windows/Linux) to display the Preferences/Settings dialog. This dialog is searchable so the fastest way to find the settings is by typing in code style.
🌐
CodeGym
codegym.cc › java blog › random › intellij idea: coding style and code formatting
IntelliJ IDEA: Coding style and code formatting
December 19, 2023 - An annotation on the same line as a method declaration, which looks ugly, right? How to fix this? IntelliJ IDEA has a "Code" menu entry for various code manipulations. One such manipulation is "Reformat Code", which you can apply using Ctrl+L.
🌐
JetBrains
plugins.jetbrains.com › docs › intellij › code-formatting.html
Code Formatter | IntelliJ Platform Plugin SDK
1 month ago - For example, it can be used to adjust the formatting range or modify the code by adding, removing, or converting elements like braces, semicolons, quotes, etc. All the introduced changes will be handled by the main formatting step. To register a formatting pre-processor, a plugin has to provide an implementation of PreFormatProcessor and register it in the com.intellij.preFormatProcessor extension point.