Write or Paste SQL
Enter your SQL in the worksheet. It doesn't matter how messy it is — single line, no indentation, inconsistent spacing — all fine.
Turn messy SQL into clean, readable code with one shortcut. Customize formatting rules to match your team's style guide.
# Format action
shortcut_win = Ctrl + F7
shortcut_mac = Cmd + F7
alt = right-click → Format · Edit → Advanced → Format
# Configuration
config = Tools → Preferences → Code Editor → Format
rules = indent · line breaks · keyword case · alignment
scope = selection (if any) or entire worksheet
undo = Ctrl+Z (single action)
time = instant
// idempotent — formatting twice yields the same result
See what the formatter does in one step.
select u.id,u.name,u.email,o.order_date,o.total from users u inner join orders o on u.id=o.user_id where o.status='completed' and o.total>100 order by o.order_date desc;
SELECT u.id,
u.name,
u.email,
o.order_date,
o.total
FROM users u
INNER JOIN orders o
ON u.id = o.user_id
WHERE o.status = 'completed'
AND o.total > 100
ORDER BY o.order_date DESC;
One shortcut does it all. Three steps.
Enter your SQL in the worksheet. It doesn't matter how messy it is — single line, no indentation, inconsistent spacing — all fine.
To format specific code, select it first. To format the entire worksheet, just place your cursor anywhere.
Windows: Ctrl + F7
Mac: Cmd + F7
Or right-click → Format
If you prefer menus over keyboard shortcuts.
Go to Tools → Preferences → Code Editor → Format to customize:
Set indent size (2, 4, or 8 spaces). Choose tabs vs spaces.
Control where lines break — after SELECT, before FROM, etc. Set max line length.
Uppercase keywords (SELECT, FROM, WHERE) or lowercase — your choice.
Align column lists, JOIN conditions, and WHERE clauses for readability.
Three practical habits that make the formatter pay off.
Ctrl+Z to undo. Formatting is a single undoable action.Useful neighbours for SQL editing.
Ctrl+F7 is one of 50+ shortcuts SQL Developer ships with. The cheat sheet covers query execution, code editing, navigation, and file operations — most of the daily-use ones are F5, Ctrl+Enter, Ctrl+/, Ctrl+Space.
See also: Run SQL Scripts · Export to CSV · Don't have it yet? Download SQL Developer