SQL Formatter

Break long SQL queries into lines and capitalise the keywords.

SQL Formatter

.sql

Paste text or open a file to see the result.

What it does

Splits a long SQL query into lines at SELECT, FROM, JOIN, WHERE and other clauses and writes the keywords in capitals. It helps when you read a query copied from a log or an ORM, or want to review it before running it. You get the same query, easier to read.

About the .sql format

.SQL file extension
File Type
Structured Query Language Data File
MIME
application/sql

SQL is a database query and data manipulation language. The .SQL extension refers to a file that stores SQL commands in a text file.

SQL Formatter questions

How do I use the SQL Formatter?

Paste the text into the Input box or open a file, set the options, then copy or download the result.

Does renaming a file to .sql change its format?

No. The extension only tells programs what to expect, and the content of the file stays the same. To change the format, convert the file. The .sql page lists programs and converters for it.