SQLCleanr

Free browser tool

Format and beautify SQL queries online

Transform dense SQL into readable queries with configurable indentation, keyword case, and compact or expanded layouts. SQLCleanr also validates common syntax issues so problems are easier to spot before execution.

Input

Characters
0
Lines
0

Output

Characters
0
Lines
0
SELECT u.id, u.name, o.total FROM users u LEFT JOIN orders o ON o.user_id = u.id WHERE u.age > 18 AND o.status = 'paid' ORDER BY u.name;

Common uses

SQLCleanr examples

Beautify complex queries

SELECT * FROM users WHERE active=1 SELECT * FROM users WHERE active = 1

Indent joins, clauses, subqueries, and conditions to make SQL easier to understand.

Standardize keyword case

select name from users SELECT name FROM users

Convert SQL keywords to upper or lower case for a consistent team style.

Compact SQL for sharing

SELECT * FROM users WHERE id = 7 SELECT * FROM users WHERE id = 7

Reduce unnecessary whitespace when embedding or transferring a finished query.

What it can do

SQLCleanr features

Multiple layout modes

Choose expanded formatting for readability or compact formatting for shorter output.

Style controls

Configure keyword case and indentation size to match your SQL conventions.

Query validation

Surface common syntax and structural issues without connecting to a database.

Three simple steps

How to use SQLCleanr

  1. 1

    Paste a SQL query

    Add a statement or multi-query script to the Input field.

  2. 2

    Choose a SQL style

    Set the layout, indentation, keyword case, and cleanup options.

  3. 3

    Format and inspect

    Run SQLCleanr, review validation feedback, and export the formatted query.

Helpful answers

SQLCleanr FAQs

Can SQLCleanr change keyword case?

Yes. You can format recognized SQL keywords in upper or lower case.

Does SQLCleanr validate queries?

It checks for common structural and syntax problems, but it does not connect to a database or execute SQL.

Can I choose the indentation size?

Yes. Adjust the indentation and layout options to match your preferred SQL style.