SQL Formatter

Re-indent a SQL statement with consistent keyword casing so a long query can be read at a glance.

  • 100% Free
  • No account required
  • Runs in your browser
  • No data is uploaded
Not saved automatically

Private to this browser, not a cloud backup. Saves expire 7 days after the last save. Avoid saving sensitive data on shared devices.

Saved SQL Formatter workspaces

Saved only on this device. Clearing browser data removes your workspaces. Expired saves are removed when this app next checks storage.

No saved workspaces for this tool yet.

No settings needed
SQL to Formatted SQL

Input

Paste or edit your SQL, then click “Run tool”.

Type, paste or drop a file
SQL
Ln 1, Col 1Spaces: 2UTF-873 bytes

Output

Formatted SQL (read-only).

Read-only
Text
Ln 1, Col 1Spaces: 2UTF-80 bytes
Ready when you arePaste your input, then press Run tool or ⌘ ↵

Using the SQL Formatter

Overview

Re-indent a SQL statement with consistent keyword casing so a long query can be read at a glance.

Read long generated queries, review migrations and share SQL that people can follow.

How to use it

  1. Paste or type your SQL into Input, drop a file onto it, or press Example to load a sample.
  2. Press Run tool, or ⌘ ↵ from anywhere on the page.
  3. Read the result in Output, then copy or download it. The Result tab has size, line counts and next steps.

Input

SQL.

Output

Formatted SQL.

  • Keywords in upper case
  • Two-space indentation
  • One clause per line
  • Standard SQL dialect

Tips

  • Formatting a document also validates it: if it will not format, it will not parse.
  • Minify for transport, format again when you need to read it.
  • Keep inputs under about 2 MB so the tab stays responsive.

Keyboard shortcuts

⌘ ↵
Run the tool
⌘ K
Search every tool
/
Filter the sidebar