SQL Formatter

Format and beautify SQL queries with proper indentation and uppercased keywords. Free online SQL formatter, no signup needed.

Preparing private browser tool…

Your file will stay on this device.

Frequently asked questions

Which SQL dialects are supported?
Standard ANSI SQL with common extensions (MySQL, PostgreSQL, SQLite, SQL Server, Oracle). The formatter recognizes 50+ keywords. Vendor-specific syntax may not format perfectly.
Does it validate the SQL?
No. The formatter rearranges whitespace and capitalizes keywords - it does not check for syntax errors or run the query. Use your database client to validate.
Can I keep keywords lowercase?
The current version uppercases keywords by default (industry convention). Disable by editing the format() call - or copy and lowercase via the text-case tool.
Does it preserve string literals?
Yes. Single and double-quoted strings are tokenized and never reformatted, even if they contain SQL keywords.
Is my query sent anywhere?
No. Formatting runs entirely in your browser with plain JavaScript. Nothing is sent to a server.