SQL Query Formatter

Paste a query written on a single line and get it back structured and readable.

Source text
Result

The SQL query formatter is a free tool that runs entirely in your browser, with no data ever sent to a server. Make a single-line query readable again.

Why indent a query

A hundred-character query on one line quickly becomes impossible to reread, especially with several joins. Breaking each clause onto its own line reveals the structure: what you select, from where, under which conditions.

What formatting reveals

An indented query exposes logic mistakes: a condition in the wrong WHERE, a forgotten join, a badly closed parenthesis. Formatting is often how the bug gets found.

What this tool does not do

This tool formats without parsing the full SQL grammar. Very specific dialects, stored procedures and queries holding embedded application code may come out imperfectly indented.

Frequently asked questions

Is my query sent to a server?

No. Processing is entirely local, which matters here in particular: a query often holds table names and conditions that reveal a database’s internal structure.

Does the tool fix syntax errors?

No: it formats the text as given. An invalid query will come out formatted but still invalid.

Is my data sent to a server?

No: the text you type or paste is processed entirely in your browser, on your device. It is never transmitted to a server.

Do I need an account or an install?

No: the tool works directly on this page, with no sign-up and no installation.