SQL Formatter
Choose keyword casing while formatting SQL for review and diffs.
Runs in your browser. Nothing is uploaded.
Format SQL privately
TheDevTab formats SQL only. It does not run queries, connect to a database, or execute SQL.
The pretty print is dialect-agnostic and stays in your browser. Nothing is uploaded while you work.
Dialect-agnostic formatting
The formatter applies readable spacing, indentation, and clause breaks without trying to identify every feature of PostgreSQL, MySQL, SQLite, SQL Server, or another database. Common statements are easier to scan after formatting, but unusual operators, vendor extensions, and procedural syntax may remain close to their input layout. Check the output against the dialect your database accepts.
Formatting is not parsing. The page does not build a database-specific syntax tree, resolve table names, or know the schema behind a query. A result that looks tidy can still contain a missing table, an invalid function, an unsafe filter, or a query that takes too long.
Formatter versus linter
A formatter changes presentation so humans can review a query. A linter checks rules such as naming, joins, selected columns, and prohibited functions. This tool is not a linter and does not replace a database parser, migration check, query plan, or code review. Run those checks in the environment that has the correct dialect and permissions.
It also never connects to a database or runs the query. That is intentional. Paste a sample query or a redacted statement, format it, and review the output before sending it to your normal development tools. If you need to test a pattern in a query string, the Regex Tester also runs locally.
Use the output as a review aid
Start with a query that has clear clauses and string literals. Use the Sample action to see the spacing rules, then paste your own SQL and compare the before and after text. Keep comments and vendor syntax under review because a generic pretty printer cannot know their intent. The Review the formatted result before sending it to your normal development tools.
FAQ
Does SQL Formatter send my query to a database?
No. The formatter tokenizes and lays out the query in your browser, without opening a database connection. The SQL is never uploaded or executed by TheDevTab.
Does the SQL Formatter run queries?
No. This tool only formats SQL text and returns a new string. It never connects to a database, binds parameters, or executes a query.
Which SQL dialects does TheDevTab support?
The formatter is dialect-agnostic and applies lightweight spacing, keyword, and clause rules. It does not parse or validate a specific database dialect, so unusual vendor syntax should be reviewed.
What does the Keyword case setting change?
Keyword case can render the formatter's recognized keywords in upper case, lower case, or their original spelling. Identifiers and string contents are not converted as SQL keywords.
Is the SQL Formatter a linter?
No. It changes spacing and layout for readability but does not prove that a query is valid for a particular database. It also does not check team-specific style rules.
How does it handle strings, comments, and quoted identifiers?
Single- and double-quoted strings, backtick or bracketed identifiers, and line or block comments are tokenized separately from SQL words. An unclosed string or quoted identifier is reported instead of being formatted as a complete query.