Formatador SQL
Format and beautify SQL queries with customizable indentation and keyword casing.
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
- Paste SQL: Enter any SQL query — from a single
SELECTto complex multi-join queries with subqueries and CTEs. - Choose dialect: Select MySQL, PostgreSQL, SQLite, T-SQL (MSSQL), or standard ANSI SQL formatting.
- Format or minify: Beautify for readability (keyword capitalisation, indentation, line breaks) or minify to a single line for embedding in code.
- 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
- Keyword capitalisation — SELECT, FROM, WHERE, JOIN in uppercase
- Clause indentation — each major clause on its own line
- Subquery formatting — nested queries indented clearly
- Dialect-aware — MySQL, PostgreSQL, T-SQL, and SQLite dialects
- Minify mode — collapse to single line for embedded queries
Related Tools
JSON Formatter & Validator
Format, minify, and validate JSON instantly. Configurable indentation and error messages.
CSV to JSON Converter
Convert CSV data to JSON arrays or objects with customizable delimiters.
HTML Table Generator
Build HTML tables visually with a spreadsheet editor. Customize styles, export clean HTML code.