Home / Developer Tools / SQL Formatter
Free online tool

SQL Formatter

Format or compact SQL and normalize keyword case for easier review without connecting to a database. Processing takes place locally in your browser.

Start using

SQL Formatter

Format or compact SQL and normalize keyword case for easier review without connecting to a database.

Formatting uses syntax parsers in a cancellable background worker and does not execute pasted code. Quoted text is preserved. Maximum input: 500000 characters; maximum output: 4000000 characters. Processing stops after 5 seconds; excessive nesting and unsupported syntax produce an error. Review and test the result before using it.

This tool uses generic SQL formatting and has no database dialect selector. Formatted output does not confirm that a query is valid or safe to execute; check it with the intended database. It does not execute SQL. Initial formatter loading can take up to 30 seconds; the 5-second processing limit starts after it is ready.

Processing takes place locally in your browser.