LazyTools

🔒 Every tool runs in your browser — the files and values you enter are never uploaded to any server. How it works

🗃️ SQL Formatter

Paste messy or minified SQL and get it pretty-printed with consistent indentation, line breaks and keyword casing — for the database dialect you choose.

Beautifies (pretty-prints) SQL with consistent indentation, line breaks and keyword casing, for the dialect you choose. Great for cleaning up generated or minified queries and making them readable in code review. Your SQL — which can reveal schema and data — is formatted entirely in your browser and never uploaded. 🔒

Rate this tool:
Anonymous — no account, no identifier

How the sql formatter works

The formatter parses your SQL for the chosen dialect and re-prints it with each clause on its own line, nested expressions indented, and keywords cased consistently (upper, lower or preserved). It understands dialect-specific syntax for MySQL, PostgreSQL, SQLite, SQL Server (T-SQL), BigQuery, Snowflake, Spark and standard SQL. Everything runs in your browser, so queries — which can reveal your schema and data — are never uploaded.

Formatting only changes whitespace and keyword casing; it never alters what your query does. Pick the dialect that matches your database for the most accurate results, especially with vendor-specific functions and syntax. It's ideal for tidying up ORM-generated or one-line queries before code review, or making a complex query readable while you debug it.

Frequently asked questions

How do I format SQL?

Paste your query, choose the database dialect and keyword casing, and click Format SQL. You get a clean, indented version you can copy — all done locally in your browser.

Does formatting change my query's results?

No. It only adjusts whitespace, line breaks and the letter case of keywords. The logic and results of the query are completely unchanged.

Which SQL dialects are supported?

Standard SQL plus MySQL, PostgreSQL, SQLite, MariaDB, SQL Server (T-SQL), BigQuery, Snowflake and Spark SQL. Choosing the right one handles dialect-specific syntax correctly.

Is my SQL sent to a server?

No — the formatting runs entirely in your browser, so your queries and the schema they reveal never leave your device. It works offline once loaded.

Related developer tools