SQL formatter
Paste a SQL query to format it with clean indentation and consistent keyword case. Pick your database dialect so its own syntax, such as backticks or [brackets], is understood.
- ๐ Runs on your device
- โค 0 bytes uploaded
- โ Free, no sign-up, no watermark
How to use SQL Formatter
- Paste your SQL or open a .sql file.
- Choose the database dialect.
- Pick keyword case, indentation and layout.
- Copy or download the formatted SQL.
About SQL Formatter
Formatting uses the open-source sql-formatter library, running in your browser.
Is it private?
Yes. SQL Formatter runs entirely in your web browser: what you type into it is never sent to Nolo or anyone else, and the page's security policy only allows it to talk to nolotools.com. The site sends only two small things: the words typed in the optional search box, to find a tool, and, the first time you use a tool on a page, that tool's name for an anonymous daily count of tool use (nothing about you, your files or what you typed). Nothing is stored either: close the page and it is gone. How Nolo works.
Questions and answers
Is my SQL sent to a server?
No. Everything runs in your browser and your SQL never leaves your device. The page is not allowed to talk to any other site, so it is safe to use with real data and secrets.
Which databases are supported?
Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Redshift, DuckDB, ClickHouse, Spark, Hive, Trino/Presto, IBM Db2, SingleStore, TiDB and Couchbase N1QL.
Does it check that my SQL is valid?
Only partly. The formatter must understand the structure, so some syntax errors stop it, but it does not check table names, column names or types. Run the query in your database to be sure.
Does formatting change what the query does?
No. Only whitespace and the case of keywords, data types and function names change. Strings, quoted identifiers and comments are kept as written.
Can it format several statements?
Yes. Statements separated by semicolons are formatted one after another with a blank line between them.