Entrada
MAYÚSCULASIndent
Salida
Elige una operación para empezar

Formateador SQL online

One-line SQL is hard to review. This tool restores its structure: every major clause on its own line, field lists and conditions one per line, JOIN / ON / AND indented by level, and keywords uppercased — subqueries, INSERT, UPDATE and CREATE TABLE follow the same rules.

Indent width (2 or 4 spaces) and keyword casing are both optional, and the output only changes layout, never meaning. Everything runs locally in your browser; your SQL never leaves the page.

Features

How to use

  1. Paste the SQL you want formatted into the left panel — one statement or a whole script.
  2. Adjust the "MAYÚSCULAS" (uppercase) and Indent options if needed.
  3. Hit Formatear (Format) and read the result on the right.
  4. Copy or download the result and paste it back into your database client.

FAQ

Does this page collect my data?

No. The content is either baked into the HTML at build time or every calculation runs locally in your browser, so your input is never sent to any server. Apart from the footer traffic counters (Baidu Analytics and our self-hosted visitor counter, see the privacy policy), this site collects nothing about your visit.

Does formatting change the meaning of my SQL?

No. Only whitespace and line breaks change: keyword casing, indentation and clause breaks. String literals, comments and identifiers are preserved exactly as written.

Which SQL dialects are supported?

The layout rules target common SQL and cover the usual MySQL, PostgreSQL, SQLite and SQL Server syntax: multi-word keywords (GROUP BY, LEFT OUTER JOIN), qualified names (schema.table) and all three quote styles are recognised.

Why did my comments move?

Line comments (-- and #) and block comments (/* */) are kept verbatim as their own tokens, but the line they sit on is re-indented with the surrounding clause. Comment text itself is never modified.

Why does the comma inside a function not break the line?

Commas inside parentheses are treated as function arguments and stay inline (count(a, b)); only top-level lists such as the SELECT list or GROUP BY break one item per line, so function calls are never torn apart.

Related tools & reading

Comentarios

Este sitio es solo frontal: sin backend ni cuentas. Los comentarios van a GitHub Issues, Discussions o correo.

Pega esto en el issue o correo para ayudarme a localizar el problema; no incluye nada de lo que escribiste

También:Ver comentarios existentes · Comentarios por correo (sin cuenta de GitHub):278975598@qq.com