SQL Formatter — Beautify SQL Queries Online
Format SQL for MySQL, PostgreSQL, SQL Server, SQLite, BigQuery and more, with keyword case control. Free, no sign-up, and your files never leave your device.
Free, with no sign-up and no watermark. The file is processed in your browser and never uploaded.
Paste a long, single-line query and get readable SQL with clauses on their own lines, consistent indentation and keyword casing. Choose your dialect — MySQL, PostgreSQL, SQL Server, Oracle, SQLite, BigQuery, Snowflake and more — so dialect-specific syntax is understood.
Step by step
- Paste SQL: One query or many separated by semicolons; or open a .sql file.
- Pick the dialect: Choose the database you use from Dialect.
- Set keyword case: UPPER, lower, or As typed.
- Copy the result: Copy or download
query.sql.
Handy for
Code review
Make generated or minified queries reviewable.
Debugging ORMs
Format the SQL an ORM logged to understand it.
Documentation
Paste clean queries into docs and tickets.
Learning
See the structure of complex joins and subqueries.
Good to know
Formatting never changes what the query does — only whitespace and keyword case.
Multiple statements are separated by a blank line.
Questions
Does it run or validate my query?
No. It only formats text. Nothing connects to a database.
Is my data sent anywhere?
No. Everything is processed by JavaScript in your browser tab — nothing you paste or open is uploaded, logged or stored on a server. You can even use the tool offline once the page has loaded.
More Developer Tools tools
- HTML, CSS & JavaScript Formatter — Beautify HTML, CSS, JavaScript, TypeScript and JSON with Prettier, running entirely in your browser.
- JavaScript, CSS & HTML Minifier — Minify JavaScript with Terser, CSS and HTML safely, and see exactly how many bytes you saved.
- Base64 Encoder & Decoder — Encode and decode Base64 for UTF-8 text and any file, including the URL-safe variant.
- Image to Base64 Converter — Convert images into Base64 data URIs with ready-to-paste HTML and CSS snippets.
- Base64 to Image Converter — Paste a Base64 string or data URI to preview the image, detect its type and download it.
- URL Encoder & Decoder — Percent-encode or decode URLs and components, and break query strings into an editable table.