SQL Formatter
Beautify SQL queries with proper indentation and line breaks. Nothing is uploaded — it works offline.
Format and beautify SQL queries online — SELECT, INSERT, UPDATE, DELETE, JOINs and subqueries — with clean indentation, line breaks after commas and optional keyword uppercasing. Paste messy SQL from logs or code and get readable, copy-ready SQL instantly, entirely in your browser.
How to use the SQL Formatter
- Paste your SQL query into the input box.
- Choose keyword case and indent size, then hit Format.
- Copy the formatted SQL back into your editor or documentation.
Frequently asked questions
How do I format SQL online?
Paste your query above and click Format. The formatter breaks keywords onto new lines, indents by parenthesis depth and puts each column on its own line.
Does it support PostgreSQL, MySQL and SQL Server?
Yes — the formatter is dialect-neutral and works with any SQL: standard keywords, JOINs, subqueries and common clauses.
Can it uppercase keywords?
Yes — the Uppercase keywords option is on by default; toggle it off to keep your original casing.
Is my SQL uploaded anywhere?
No. Formatting runs entirely in your browser, so private queries never leave your machine.
Fun facts about SQL Formatter
- SQL (Structured Query Language) was originally called SEQUEL (Structured English Query Language) and was developed at IBM in the early 1970s.
- SQL is one of the few programming languages that reads almost like English — 'SELECT name FROM users WHERE age > 21' is valid SQL.
- The SQL standard has been revised multiple times — SQL:2023 is the latest version, adding support for property graphs and JSON.
- SQL is declarative — you describe what data you want, not how to get it. The database's query optimizer decides the best execution plan.
- The most common SQL injection attack uses the classic `' OR 1=1 --` payload, which bypasses authentication by making the WHERE clause always true.