SQL Formatter
Format messy SQL into clean, readable queries fast
gpt-4o-mini
Your prompt will appear here…
Your beautifully formatted article will appear here once you generate.
No history yet
Your generations will appear here. Sign in to save them permanently.
Have you inherited a query that runs to eighty words on one line? Can you find the joins in it without counting brackets? SQL Formatter on EizTools takes messy SQL and lays it out properly, so the structure of the query becomes something you can read rather than decode.
Short answer: SQL Formatter is free on EizTools, and it turns messy SQL into clean, readable queries. Paste your statement and it applies consistent indentation, keyword casing and line breaks without changing the logic.
What is SQL Formatter?
SQL Formatter is a layout tool for queries. Keywords get consistent casing, clauses go on their own lines, joins are indented so their conditions sit with them, and nested subqueries become visibly nested.
The logic of the query is untouched. That is the point of a formatter: the same statement, arranged so a person can follow it, without a single character of behaviour changing.
Why Nobody Can Read The Query That Works
Queries grow. Someone adds a join, somebody else adds a condition, and nobody reformats because the query works and touching it feels risky. The result is familiar:
- Joins whose conditions sit nowhere near the tables they join.
- Keywords in three different cases within one statement.
- Subqueries nested so deeply that nobody can see where one ends.
How Does SQL Formatter Work?
Paste the statement into the prompt box. Select a model, set the strictness to match your house style, then press Generate. The formatted query appears in the output card with a copy button on the code block, and downloads as TXT, Word or HTML.
select o.id,c.name,sum(l.qty) from orders o join customers c on c.id=o.customer_id
join lines l on l.order_id=o.id where o.status='open' group by o.id,c.name
That comes back with each clause on its own line, the joins indented with their conditions, and keywords in consistent case. The same query, and suddenly you can see that the grouping matches the selected columns.
Choosing Strictness And Style
| Control | What it changes | Suggested |
|---|---|---|
| Operation Focus | The kind of work applied, from Format to Restructure and Analyze | Format, so the logic stays exactly as written |
| Output Style | Clean Text, Formatted, Structured or Annotated | Formatted, or Annotated when explaining the query to someone |
| Strictness | Light, Standard, Strict or Aggressive layout rules | Standard, which suits most house styles |
| Preserve Meaning | A toggle keeping the statement behaviour identical | On, without exception |
Show Changes, Keep Formatting and an Intensity slider fill out the panel, and the Custom Instructions box is where your team's conventions belong, such as leading commas or keywords in lower case.
Caution Formatting should never change results. Run the formatted query against a test environment and compare row counts before it replaces anything in production, particularly on statements that write data.
Best Use Cases
Before a code review
A formatted query gets reviewed properly. An unformatted one gets approved unread.
Understanding inherited SQL
Laying out the clauses is usually enough to see what a legacy query is really doing.
House style consistency
Put your conventions in the instructions box and every query comes back matching them.
EizTools is free to use, needs no account, and each tool comes with options built for its own job rather than one shared panel. You select the AI model on the page before each run. When you need a query written from scratch rather than tidied, the SQL Generator is the tool for that.
Frequently Asked Questions
Does SQL Formatter change how my query behaves?
It should not. Keep Preserve Meaning on and Operation Focus set to Format. Even so, test the formatted statement before it replaces anything live, especially if it writes or deletes data.
Which SQL dialects does it handle?
The common ones all work, since formatting is largely dialect independent. Name your database in the prompt when you use vendor specific syntax, so unusual keywords are laid out correctly.
Can it follow my team's formatting conventions?
Yes. Put the rules in the Custom Instructions box, such as leading commas, keyword casing or indent width, and the same conventions get applied to every query you run through it.
Will it explain what the query does?
Set Output Style to Annotated and it adds short notes alongside the clauses. That is genuinely useful when handing an inherited query to somebody who has never seen it.
Unreadable SQL does not stay unreadable for free. It gets copied, patched around, and eventually rewritten by someone who could not tell what the original was doing. Ten seconds of formatting keeps a query maintainable. Paste your worst statement into SQL Formatter above and read it properly.