What does this SQL formatter do?
It reformats SQL text with consistent indentation, keyword casing, and line breaks so queries are easier to read, review, and maintain.
Format, beautify, and minify SQL locally with multi-dialect support.
All formatting runs locally in your browser. Large scripts use a background worker.
Consistent SQL formatting improves code reviews, documentation, onboarding, and debugging. Teams that agree on keyword casing, indentation, and clause layout spend less time deciphering one-line ORM output and migration scripts.
-- Before select u.id,u.name,o.total from users u inner join orders o on u.id=o.user_id where o.total>100; -- After SELECT u.id, u.name, o.total FROM users u INNER JOIN orders o ON u.id = o.user_id WHERE o.total > 100;
It reformats SQL text with consistent indentation, keyword casing, and line breaks so queries are easier to read, review, and maintain.
No. Formatting runs entirely in your browser. Your SQL never leaves your device unless you copy or download it yourself.
PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Redshift, DuckDB, DB2, Trino, Spark, Hive, ClickHouse, and generic SQL.
Optional heuristic detection suggests a dialect based on syntax markers. You should still pick the correct dialect manually when accuracy matters.
Yes. Switch mode to Minify to produce compact SQL. Comment removal during minify is optional and off by default.
Pretty-printing changes whitespace and layout only. It is not a semantic validator. Always review formatted output before running against production databases.
Small and medium scripts format instantly. Inputs above ~300 KB use a Web Worker. Very large dumps (tens of MB) may slow the browser; split files when possible.
Yes. Upload or drag-and-drop .sql or .txt files into the input editor.
Yes. Statements split on semicolons outside quoted strings are formatted individually and rejoined with configurable blank lines.
Yes for common syntax in supported dialects. Complex vendor-specific procedural blocks may require the matching dialect setting.
UPPERCASE, lowercase, or preserve original keyword casing. Identifier, function, and data type casing can be configured separately.
Yes. Enable Use tabs and choose indent width for space-based indentation when tabs are disabled.
It shows original and formatted SQL side by side so you can verify layout changes before copying output.
Estimated metrics such as statement count, line count, JOIN count, CTE count, subquery depth, and dialect guess confidence.
Lightweight checks such as SELECT *, DELETE/UPDATE without WHERE, and common reserved-word identifier patterns. These are suggestions, not a full SQL linter.
It performs basic structural checks (empty input, unbalanced parentheses, unterminated quotes/comments). Full syntax validation depends on the formatter engine and chosen dialect.
Yes for typical dump sizes. Extremely large bulk INSERT dumps may be slow in the browser; consider splitting the file or using a CLI formatter.
Yes in beautify mode. Minify mode can optionally strip comments when you explicitly enable that setting.
Yes. Copy to clipboard or download as a .sql file from the output panel.
After the page loads, formatting works offline because processing is client-side.
Ctrl+Enter (Cmd+Enter on Mac) formats SQL immediately. Auto-format can be toggled for debounced live formatting while typing.
Yes. SQL to Text and Text to SQL include handoff buttons that open this formatter with your current SQL preloaded.
Partially, depending on dialect. PL/SQL and T-SQL procedural blocks work best when you select Oracle PL/SQL or SQL Server dialect.
The input may contain syntax the selected dialect does not recognize, or there may be unbalanced parentheses or unterminated strings. Try another dialect or fix the reported error location.
Yes. There is no account, usage limit, or per-query charge. All processing is local and free.