SQL Formatter
Format and indent SQL queries for MySQL, PostgreSQL, SQLite, SQL Server and BigQuery.
To format SQL, paste your query above and it is re-indented with each clause on its own line. Choose your dialect so that database-specific syntax such as BigQuery backticks or SQL Server brackets is parsed correctly rather than mangled.
Runs in your browser- Privacy
- Runs entirely in your browser — nothing is uploaded
- Cost
- Free, unlimited, no sign-up
Frequently asked questions
Does formatting change how a query runs?
How to use the sql formatter
- 1Enter or paste your sql.
- 2Choose the dialect.
- 3Turn "Uppercase keywords" on or off as needed.
- 4The result appears immediately — copy or download it.
Embed this tool
Put the working sql formatter on your own site. It runs in your visitors' browsers exactly as it does here — free, no account, nothing uploaded.
Share this tool
Related tools
Sample SQL Data GeneratorGenerate CREATE TABLE and INSERT statements with realistic seed data for four SQL dialects.SQL IN Clause BuilderTurn a pasted column of values into a safely quoted SQL IN clause, batched if needed.JavaScript & TypeScript FormatterFormat JavaScript, TypeScript, JSX and TSX properly with Prettier.JSON Formatter & ValidatorFormat, validate, repair and analyse JSON — with errors that point at the exact line.Excel to SQL ConverterGenerate CREATE TABLE and INSERT statements from a sheet.Wrap Lines in Quotes or BracketsAdd a prefix and suffix to every line and join them — build SQL IN lists, arrays and CSV rows.
Last updated
More data & format tools