All tools · 📐 Format / Inspect

📐 SQL Formatter

Paste any SQL query — we format with proper indentation, uppercase keywords (SELECT, FROM, WHERE), and aligned column lists. Handles SELECT, INSERT, UPDATE, DELETE, CTE, JOINs.

Loading tool…

Examples

Messy one-liner
Inputselect id,name from users where active=1 order by id
OutputSELECT id, name FROM users WHERE active = 1 ORDER BY id;
JOIN query
Inputselect u.name,count(o.id) from users u left join orders o on o.user_id=u.id group by u.name
OutputFormatted with each clause on its own line, joined columns indented.

Frequently asked questions

Which SQL dialect is supported?

Generic ANSI SQL. Dialect-specific syntax (Postgres LATERAL, MySQL backticks, T-SQL TOP) may not format optimally but won't break.

Why uppercase keywords?

Convention since the 70s — improves scannability. Some teams prefer lowercase ("modern" style); both are valid.

Will it preserve my comments?

Single-line (-- comment) and block (/* */) comments are preserved as-is.

About this tool

SQL Formatter runs entirely in your browser using standard Web APIs. No data is sent to any server. The source for this tool is in our public GitHub repository.

Related tools

← All 96 tools

Why this tool

vs typical free web-tool sites

1vwTypical free site
PriceFreeFree
Signup requiredNoOften (for premium features)
Ads inside the toolNoYes (banner + video)
Data sent to serverNo (browser-only)Yes (inputs analyzed for ads)
Total tools96Often <20 or scattered across sites
Bookmarkable URL per toolYesMixed
Loads in under 1sYes (static)Often slow (ad tracking)
MultilingualEN / ES / PT / FR / DEUsually EN only
Open sourceYesNo