# SQL formatter: run it free, or from your agent

Formats or minifies SQL with one clause per line, indented subqueries, keyword case and dialect-aware quoting.

## Prompt

Use looot to review the SQL my agent wrote for a report. 1. Set up https://looot.ai/skill.md. 2. Format this query with one clause per line: [paste SQL]. 3. Explain what each clause does in one line. 4. Flag a missing WHERE on UPDATE or DELETE, SELECT star on a wide table and a join without a condition. 5. Return the formatted query and the flags.

## What it needs

A SQL query

## What comes back

- formatted SQL
- one line SQL
- keyword case
- indent width

## Endpoints and providers

None. The tool on the web page runs in the browser and calls no endpoint.

## What it costs

Nothing. The tool on the web page runs in the visitor's browser: no account, no API call and no limit per hour. The prompt above runs the same job from your own looot account with current data, billed per call.

## Read agent SQL

Format the one-line query an agent or an ORM logged so you can review it.

## Tidy a migration

Clean up a query before it goes into a migration or a pull request.

## Debug a slow query

Lay out the joins and filters so a missing condition stands out.

## Minify for logs

Collapse a formatted query to one line for a log or a string literal.

## How do I format a SQL query?

Paste it in the box. The formatted query appears as you type, with each clause on its own line. Copy it or download a .sql file.

## Which SQL dialects are supported?

Standard SQL, PostgreSQL, MySQL and MariaDB, SQL Server, SQLite and BigQuery. The dialect sets how quotes and comments are read: backticks in MySQL, square brackets in SQL Server, dollar-quoted strings in PostgreSQL and # comments in MySQL.

## Does it check that my SQL is valid?

No. It lays out the text and never runs or parses it against a schema, so a typo stays a typo. Run the query in your database to check it.

## Will it change my string values or comments?

No. Quoted strings, quoted names and comments are kept exactly as written, even when they contain commas or keywords.

## Can I keep keywords in lower case?

Yes. Keywords can be UPPER CASE, lower case or kept as written. Table and column names are never changed.

## What does One line do?

It removes comments and line breaks and puts the query on one line with single spaces, for logs, string literals or a quick paste into a chat.

## Does it handle stored procedures?

Partly. Queries inside a procedure are formatted, but BEGIN, END, IF and loops keep a simple layout. It is built for queries and DML, not procedural code.

## Is my query sent anywhere?

No. Formatting runs in your browser, so queries with real table names stay on your machine.

## Related tools

- /free-tools/json-formatter
- /free-tools/case-converter
- /free-tools/diff-checker

## Last reviewed

2026-10-14.
