UtilitySansar
Développeurs

SQL Formatter / Beautifier

Turn dense SQL into a readable, consistently indented layout with one clause per line, uppercased keywords, and aligned JOINs and subqueries.

Résumé de l'outil

Cet outil accepte une entrée structurée et renvoie une sortie déterministe dans le navigateur, sans envoi au serveur.

Nom de l'outil
SQL Formatter / Beautifier
Intention d'entrée
Fournissez le contenu source à transformer, valider ou analyser.
Intention de sortie
Recevez une sortie normalisée prête à être copiée, réutilisée ou déboguée.
Entrée d'exemple
select id,name,email from users where created_at > now()-interval '7 days' order by id desc
Sortie d'exemple
SELECT id, name, email FROM users WHERE created_at > now() - INTERVAL '7 days' ORDER BY id DESC
Keywords are uppercased; clauses go on their own line. Multiple statements separated by ; are formatted independently.

Introduction à l'outil

Turn dense SQL into a readable, consistently indented layout with one clause per line, uppercased keywords, and aligned JOINs and subqueries.

Vue d'ensemble de l'outil

A well-formatted SQL query reads like a paragraph, not a wall of words. This tool tokenizes your statement, places each major clause (SELECT, FROM, WHERE, GROUP BY, ORDER BY, JOIN) on its own line, indents subqueries and CTE bodies, and uppercases standard keywords. It keeps quoted identifiers, string literals, and inline comments untouched. Works with PostgreSQL, MySQL, SQLite, SQL Server, and ANSI SQL.

Cas d'usage

  • Clean up SQL pasted from logs or ORMs before reviewing it in a PR.
  • Standardize team query style without installing a CLI formatter.
  • Make a complex CTE chain readable for documentation or onboarding.

Exemples d'entrée/sortie

Intention d'entrée
select id,name,email from users where created_at > now()-interval '7 days' order by id desc
Intention de sortie
SELECT
  id,
  name,
  email
FROM users
WHERE created_at > now() - INTERVAL '7 days'
ORDER BY id DESC

Questions fréquentes

Will it modify my data or run the query?+
No. The tool only reformats the text. Nothing is executed against any database.
Does it support PostgreSQL-specific syntax?+
Yes. ::casts, $$ dollar-quoted strings, RETURNING, ON CONFLICT, and JSONB operators are recognized and preserved.
Can it format multiple statements at once?+
Yes. Statements separated by semicolons are formatted independently and joined with a blank line between them.

Explorer plus d'outils

Découvrez des utilitaires liés dans la catégorie Développeurs ci-dessous.

Parcourir tous les Développeurs

Outils liés

Utilitaires sélectionnés à la main qui pourraient vous être utiles