SQL 在线格式化工具
在浏览器中即时美化或压缩 SQL。
What Is SQL Formatter?
SQL Formatter is a free online tool that cleans up and restructures SQL queries. In Beautify mode it adds consistent indentation, breaks clauses onto new lines, and uppercases SQL keywords so your queries are easy to read and review. In Minify mode it strips comments and collapses whitespace to produce a compact single-line SQL string.
How to Use SQL Formatter
- Choose Beautify to format SQL with indentation, or Minify to compress it.
- Paste your SQL into the input panel, or click Load Sample to try an example.
- The formatted output appears instantly in the right panel.
- Click Copy to copy the result to clipboard.
Features
- Beautify mode with clause-level line breaks and 2-space or 4-space indentation
- Uppercase SQL keywords automatically
- Minify mode strips comments and collapses whitespace
- Supports SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, JOIN, WITH, and more
- Copy result to clipboard
- Runs entirely in your browser — zero data uploaded
FAQ
What is SQL Formatter?
SQL Formatter is a free online tool that either beautifies SQL queries with consistent indentation and uppercase keywords, or minifies them to a single line for use in scripts or logs.
Which SQL dialects are supported?
The formatter handles standard SQL keywords used in MySQL, PostgreSQL, SQLite, SQL Server, and Oracle. It covers SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, JOIN, and more.
Is my SQL sent to a server?
No. All formatting happens entirely in your browser. Your queries never leave your device.