Format SQL
Format and beautify SQL queries for MySQL, PostgreSQL, SQL Server, SQLite, Oracle, BigQuery and more, or minify them. Free, private, in your browser.
- Files never leave your device
- Free, no sign-up
- No watermark
About SQL Formatter
Turn long, single-line SQL into readable, consistently indented queries. Choose your dialect, including MySQL, PostgreSQL, SQL Server, SQLite, Oracle, MariaDB and BigQuery, set the indentation and keyword casing, and format or minify with one click in a code editor with syntax highlighting. Your queries are formatted in your browser and never sent to a server, which matters when they contain table names or customer data.
How to use SQL Formatter
- 1
Paste your SQL into the editor.
- 2
Choose the SQL dialect.
- 3
Set indentation and keyword case.
- 4
Format or minify, then copy the result.
Why use this tool
- Eight SQL dialects.
- Uppercase keyword option.
- Adjustable indentation.
- Format and minify modes.
- Code editor with syntax highlighting.
Frequently asked questions
Dialects have different keywords and syntax, so choosing the right one keeps the formatter from misreading your query.
No. Only whitespace and keyword case change.
Yes. The query never leaves your browser.
Standard statements format well. Complex procedural code may need small manual touches.
Yes. Minify removes extra whitespace for embedding queries in code.
No. Everything is processed in your browser tab. Nothing you type or paste is sent to CodeMites or any other server.
Yes. There is no account, no watermark and no usage limit. The tool runs in your own browser, so there is no server cost to charge you for.
Yes. It runs in any modern browser on Android and iOS as well as on Windows, macOS and Linux, with nothing to install.
Yes, once the page has loaded. Everything runs in your browser, so you can keep working on a train or plane without a connection.
Yes. Line and block comments are kept in place when the query is formatted.
Related tools
All Developer tools →- CSS FormatterBeautify messy or minified CSS with clean indentation, or minify it for production, in a code editor with syntax highlighting.
- HTML FormatterBeautify messy or minified HTML with clean indentation, or minify it, in a code editor with syntax highlighting.
- Diff CheckerCompare two texts or code files and highlight added, removed and changed lines in split or unified view.
- Regex TesterTest regular expressions with live match highlighting, capture groups, flags and a quick-reference cheat sheet.
- Cron Expression BuilderBuild cron expressions with dropdowns, read them in plain English and preview the next run times.
- Chmod CalculatorSet Unix file permissions with checkboxes and get the octal value, symbolic notation and chmod command.