DevToolBox

SQL Formatter

Beautify and minify SQL in your browser.

Please enter some SQL first.

Formatted SQL

Your formatted SQL will appear here.

How to Use

What is SQL formatting? SQL formatting makes queries readable by uppercasing keywords, breaking clauses onto indented lines and aligning commas. It is invaluable for debugging, code reviews and documentation.

How to use it 1. Paste a SQL statement into the input area. 2. Click Format to beautify. 3. Click Minify to compress into a compact single line.

What Format does - Uppercases keywords such as SELECT, FROM, WHERE, JOIN and ORDER BY. - Moves each clause to its own indented line. - Starts new lines after commas. - Preserves string literals and comments.

Tips - Minify strips comments and whitespace while keeping strings intact. - The tool does not validate SQL; it formats the text as best it can. - Unusual or malformed queries still receive a readable layout.

Privacy Formatting runs locally; your SQL never leaves the browser.

SQL Formatter - Beautify and Minify SQL