Android Studio
Reformat the code
Press Ctrl + Alt + L to reformat the code in Android Studio. On a Mac, press Cmd + Option + L instead.
Where it works: Editor
Every documented variant
| System | Environment | Keys |
|---|---|---|
| Mac | Desktop app | CmdOptionL |
| Windows | Desktop app | CtrlAltL |
Where this comes from
Keyboard shortcuts - Android Studio - Android Developers
Documentation checked on 2026-09-14. That is a documentation review, not a test run inside the application.