Entrée
MAJUSCULESIndent
Sortie
Choisissez une opération pour commencer

Formateur SQL en ligne

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 "MAJUSCULES" (uppercase) and Indent options if needed.
  3. Hit Formater (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

Commentaires

Ce site est uniquement frontal : pas de backend ni de compte. Les commentaires vont sur GitHub Issues, Discussions ou par e-mail.

Collez ceci dans l'issue ou l'e-mail pour m'aider à localiser le problème ; cela n'inclut rien de ce que vous avez saisi

Aussi :Voir les commentaires existants · Commentaires par e-mail (sans compte GitHub) :278975598@qq.com