Docelora
ToolsAboutContact
Developer tools

SQL Formatter

Turn long, single-line SQL into readable, consistently indented queries. Dialect-aware formatting covers MySQL, MariaDB, PostgreSQL, SQL Server, SQLite, Oracle PL/SQL, BigQuery, Snowflake and more.

Quick answer: paste SQL, pick your database dialect, and copy the formatted query. Keyword case can be upper, lower or preserved.

SQL Formatter

Dialects · indentation · keyword case · live

Runs on your device: everything you type or open is processed in this browser tab. Nothing is uploaded to Docelora or anyone else.

Why format SQL

Formatted SQL makes joins, conditions and subqueries easy to review and diff. Formatting is done by the open-source sql-formatter library (MIT licence); the query is never run or sent anywhere.

1. Paste SQLOne or many statements.
2. Choose the dialectFor correct keywords and operators.
3. CopyOr download query.sql.

Related tools

Frequently asked questions

Does it run my query?

No – it only reformats text.

Which databases are supported?

Standard SQL, MySQL, MariaDB, PostgreSQL, SQL Server, SQLite, Oracle PL/SQL, BigQuery, Snowflake, Redshift and Spark SQL.

Why choose a dialect?

Dialects have different keywords, quoting and operators.

Can it fix SQL errors?

No – it formats valid-looking SQL and reports what it cannot parse.

Are comments kept?

Yes.

Can I format several statements?

Yes – they are separated by a blank line.

Does it change identifiers?

No – only keyword case and whitespace.

Can I minify SQL?

Use the SQL Minifier.

Is it safe for production queries?

Yes – nothing leaves your browser.

Does it support stored procedures?

PL/SQL and T-SQL procedures are supported.

What about parameters like ? or :id?

Placeholders are kept.

Can I choose tabs?

Spaces only.

Which library is used?

sql-formatter 15 (MIT licence).

Why is my query not formatted?

An unsupported construct for the chosen dialect – try Standard SQL.

Is my code uploaded?

No – it is processed in your browser and never leaves your device.

Is it free?

Yes, with no sign-up or limits.

Can I open a file?

Yes – use “Open file”, or paste the code.

Does it work offline?

Once the page and its library have loaded, yes.

Can I copy or download the result?

Copy it with one click, or download where offered.

Does it work on a phone?

Yes, though large files are easier on a computer.

Last reviewed: 8 November 2026.