SQL formatter
Format SQL so it is easy to read: line breaks, indentation and keyword case. For MySQL, PostgreSQL, SQL Server, SQLite and Oracle — free, many files at once.
How to format SQL
- Paste your SQL into the box on the left, or open a .sql file.
- Pick your SQL dialect, the keyword case and the indentation.
- Copy the result or download the formatted .sql file.
Frequently asked questions
Standard SQL, MySQL, PostgreSQL, SQL Server (T-SQL), SQLite, MariaDB, Oracle (PL/SQL) and Google BigQuery. Pick the right one so syntax such as MySQL backticks or SQL Server [ ] brackets is read correctly.
No. It only adds line breaks and indentation and changes the case of keywords; table and column names, quoted strings and comments stay as they are.
Something is left open (a quote or a bracket) or the query uses syntax from another dialect. Check around that line, or pick a different SQL dialect.
Yes. Drop or choose several files: each is formatted on its own, and you can download them one by one or as a ZIP.
It is completely free and needs no sign-up.
Related tools
JSON FormatterFormat, minify and validate JSONJavaScript formatterBeautify JavaScript, JSX and TypeScript codeHTML formatterBeautify HTML code with clean indentationCSS formatterBeautify CSS, SCSS and Less codeURL parserSplit a link into parts and edit its queryUser-Agent parserFind browser, OS and device from a user agentCIDR CalculatorNetwork details of an IPv4 or IPv6 CIDR blockSubnet CalculatorSplit an IPv4 network into subnets, VLSM tooMIME Type LookupLook up MIME types and check a file's real type