SQL Formatter, Beautifier and Validator

Ln: 1 Col: 1

Output
Ln: 1 Col: 1

About this tool

Paste a SQL query and press Format / Beautify to put each clause on its own line with consistent indentation and keyword case. Use Minify / Compact to turn a query into one short line, or Validate to check the syntax for your database dialect.

Features

Frequently asked questions

How do I format a SQL query online?

Paste the query, choose your database and press Format / Beautify. The formatted SQL appears in the output panel.

Does it run my SQL?

No. The tool only reads and formats the text. It never connects to a database or runs a query.

Can it find every SQL error?

The check is a best-effort parser. It catches common syntax mistakes, but your database remains the final judge.

Before saving, scripts, runnable fragments and control characters are removed and the code is minified. Saved codes are shown beautified. Using a name you already saved replaces that code.