SQL Formatter

Developer Tools

Beautify or minify SQL queries

FreePrivateInstant
Add a file · .txt .md .csv .json … · up to 2.00 MB
Indent
Embed this tool on your websiteFree
  1. Choose how tall the frame should be.
  2. Press Copy code.
  3. Paste it into your page, blog, WordPress or Notion HTML block.
Height

The tool runs inside your visitor's browser, nothing is uploaded, and a small "Powered by ToolCloak" line stays under it. The second line (script) is optional: it makes the frame fit the tool's height.

Similar tools you may like

History

All history →

SQL Formatter — at a glance

Turn a long, messy SQL query into neat, readable code — or squeeze it into one line.

Messy SQL
select a,b from t where x=1
Run
Clean SQL
SELECT
a,
b
FROM t
WHERE x=1

How to use it — step by step

A SQL query (SELECT, INSERT, UPDATE, DELETE and more).

1

Paste your input

Paste or type your content into the big input box.

2

Choose options

Pick the mode and options that fit what you need.

3

Format SQL

Press the button. The result is created instantly on your device.

4

Copy the result

Check the output and press Copy to use it anywhere.

Pro tips

Small things that make the result better.

✦Uppercase keywords make queries easier to scan.
✦Strings and quoted names are never changed.
✦Minify when you need a query on one line for logs or config.

Quick facts

Beautifyor minify
Keywordsauto uppercase
Strings safenever altered
Freeno signup

Frequently Asked Questions

Does it change how my query runs?+

No. Only spacing, line breaks and keyword case change — the logic stays identical.

Which databases are supported?+

It works for standard SQL used by MySQL, PostgreSQL, SQL Server and SQLite.

Are comments kept?+

Comments are removed to keep the output clean.

Is my data safe?+

Yes. Everything runs inside your own browser. Your text, files and images are never uploaded to any server.

More Free Tools