https://devtools.solutions/tools/sql/sql-formatter.html

Format SQL

Format and indent SQL queries for readability. Supports SELECT, INSERT, UPDATE, DELETE, and more.


    

Frequently Asked Questions

Does this execute SQL?

No. This page only reformats text and does not run queries.

Where can I minify SQL for embedding?

SQL minification is available on the SQL Minify page at /tools/sql/sql-minify.html to collapse whitespace into a compact query string.

Is formatting done server-side?

No. SQL transformations run client-side in your browser.

Example input/output

Input: SELECT id,name FROM users WHERE active=1 ORDER BY name

Output:

SELECT
  id,
  name
FROM users
WHERE active = 1
ORDER BY name

How it works

This tool applies a SQL formatting algorithm that normalises keyword case, adds line breaks before major clauses, and indents subqueries. Processing runs in your browser.

Common use cases

Related tools