How to format SQL in any editor
Some editors format SQL out of the box, some need one extension, and one of the most widely used cannot do it at all without a plugin. Each guide below covers the exact shortcut, where the settings live, and what that editor still cannot do — with a formatter on the page for the cases it cannot reach.
Which editors format SQL natively?
| Editor | Formats SQL? | Shortcut | Guide |
|---|---|---|---|
| SQL Server Management Studio | Built in | Ctrl+K, Ctrl+Q | How to format SQL in SSMS |
| Visual Studio Code | Needs an extension | Shift+Alt+F | How to format SQL in VS Code |
| Notepad++ | Needs a plugin | Ctrl+K | How to format SQL in Notepad++ |
| DBeaver | Built in | Ctrl+Shift+F | How to format SQL in DBeaver |
| IntelliJ IDEA and DataGrip | Built in | Ctrl+Alt+L | How to format SQL in IntelliJ |
| Oracle SQL Developer | Built in | Ctrl+F7 | How to format SQL in SQL Developer |
Shortcuts are the Windows and Linux bindings; each guide lists the macOS equivalent where the editor runs there. All facts re-checked against primary documentation on 20 August 2026.
The guides
Built in
How to format SQL in SQL Server Management Studio (SSMS)
SSMS 22.7 added a built-in T-SQL formatter at Ctrl+K, Ctrl+Q. Here is the shortcut, every .editorconfig option it reads, and what to do on older builds.
Needs an extension
How to format SQL in VS Code
VS Code ships no SQL formatter, so Shift+Alt+F does nothing on a .sql file. Here are the maintained extensions and the settings.json entries to match.
Needs a plugin
How to format SQL in Notepad++
Notepad++ highlights SQL but cannot format it. Install Poor Man's T-SQL Formatter from Plugins Admin, or format in the browser — both routes explained.
Built in
Format SQL in DBeaver: shortcut, keyword case and settings
DBeaver formats SQL with Ctrl+Shift+F. Here is where the formatting preferences live, how to force keyword case, and how to plug in an external formatter.
Built in
How to format SQL in IntelliJ and DataGrip
IntelliJ IDEA and DataGrip format SQL with Ctrl+Alt+L. Here is where the per-dialect SQL code style lives, the predefined styles, and the cases it cannot reach.
Built in
How to format SQL in Oracle SQL Developer
Oracle SQL Developer formats with Ctrl+F7. Here is where the Format and Advanced Format preferences live, and how to share one PL/SQL style across a team.
Formatting a specific database?
Every guide embeds the same formatter, preset to a dialect that suits that editor's usual audience. If you want it preset to yours, start from one of these instead.