SQL Formatter
Format SQL queries into clean, readable multi-line syntax. Supports MySQL, Postgres, T-SQL, BigQuery and more.
What is the SQL Formatter?
The SQL Formatter reformats a jumbled one-line query into readable, indented, multi-line SQL with consistent keyword casing. It supports MySQL, PostgreSQL, SQL Server, SQLite, BigQuery, Oracle and MariaDB.
Formatting only rearranges whitespace and casing — the query executes identically. Everything runs in your browser.
How to use the SQL Formatter
- 1Paste your SQL query into the input area.
- 2Pick the database dialect.
- 3Choose indentation width and keyword casing.
- 4Click "Format" and copy the tidied query back to your editor.
Key features
- Dialect-aware formatting for all major databases
- Configurable indentation and keyword casing
- Aligns SELECT columns, JOIN conditions and WHERE clauses
- Handles subqueries and CTEs, preserves comments
- Minify option to collapse whitespace
Frequently asked questions
Does the formatter change my results?
No — only whitespace and casing change. The query still executes identically.
Can it format stored procedures?
Yes — DECLARE, IF/ELSE and LOOP constructs are handled for popular dialects.
All Developer Tools
Tap any tool to jump straight in — no signup, works on mobile.
JSON FormatterBase64 Encode/DecodeUUID GeneratorRegex TesterSQL FormatterSQL Query BeautifierSQL Query GeneratorHTML FormatterAPI Response FormatterJSON to C# Class GeneratorJWT DecoderTimestamp ConverterData Format ConverterOnline Code Playground (HTML, CSS, JS Editor)Free API Tester Online (Postman Alternative)XML FormatterURL Encoder / DecoderSVG Viewer & Converter