Formateador SQL

Format and beautify SQL queries with customizable indentation and keyword casing.

Ad Space
Ad Space

About SQL Formatting

Well-formatted SQL is easier to read, debug, and maintain. This tool adds proper indentation, line breaks, and consistent keyword casing to your SQL queries. It supports all major SQL statements including SELECT, INSERT, UPDATE, DELETE, JOIN, and subqueries. All formatting happens client-side · your queries never leave your browser.

How It Works

  1. Paste SQL: Enter any SQL query — from a single SELECT to complex multi-join queries with subqueries and CTEs.
  2. Choose dialect: Select MySQL, PostgreSQL, SQLite, T-SQL (MSSQL), or standard ANSI SQL formatting.
  3. Format or minify: Beautify for readability (keyword capitalisation, indentation, line breaks) or minify to a single line for embedding in code.
  4. Copy the result: The formatted SQL is ready to use in your editor, documentation, or codebase.

Why Format SQL?

Database queries copied from ORMs, legacy codebases, or monitoring dashboards are often minified or inconsistently formatted — keywords in mixed case, no indentation, and no line breaks. Reformatting makes queries dramatically easier to read, debug, and review in code. Consistent formatting also improves team collaboration when SQL queries are version-controlled. The formatter follows industry conventions: SQL keywords in uppercase, each clause on its own line, and JOIN conditions indented under their ON keyword.

Formatting Features

Related Tools