SQL Formatter
Free online SQL formatter for MySQL, PostgreSQL, SQL Server and SQLite: uppercase keywords and indented subqueries.
Privacy: all processing happens locally in your browser. Your input never leaves your device.
What is SQL Formatter?
SQL printed by an ORM is usually one long concatenated line that is painful to read when chasing slow queries. This tool restores compressed SQL to a standard layout with uppercased keywords and level-by-level indented subqueries, with dialect switching for MySQL, PostgreSQL, SQL Server, SQLite and more — complex JOINs and nested subqueries become clear at a glance.
How to Use
- Paste a SQL statement
- Choose the database dialect
- It formats automatically — copy the result
FAQ
- Which database dialects are supported?
- MySQL, PostgreSQL, MariaDB, SQL Server (T-SQL), SQLite, standard SQL and more — the dialect affects keyword and identifier-quoting handling.
- Does formatting change SQL semantics?
- No. Only whitespace, line breaks and keyword casing are adjusted; the statement logic stays exactly the same.
Related Tools
JS / TS FormatterFree online JavaScript and TypeScript formatter powered by Prettier, with JSX/TSX support and reverse minify — local.CSS FormatterFree online CSS formatter based on Prettier: restore single-line stylesheets to readable indented CSS, or minify.HTML FormatterFree online HTML formatter based on Prettier: re-indent tags, normalize attributes, format embedded script and style.XML FormatterFree online XML formatter with two-space indent, preserved attributes, comments and CDATA, plus line-numbered errors.
Last updated 2026-09-04