SQL 格式化

本地美化 SQL(多方言)。

交互控件由 JavaScript 加载。处理留在浏览器内——不会上传。

正在加载工具…

如何使用

  1. Open SQL Formatter — Load the page.
  2. Paste SQL — Paste a query or script.
  3. Pick dialect — Choose the closest SQL dialect.
  4. Copy formatted SQL — Copy into your client or migration.

限制

需要启用 JavaScript。极大输入可能拖慢标签页。结果取决于浏览器 API;因不上传,没有服务器端配额。

适合什么时候用

需要快速免费工具、不想注册账号、也不想把内容交给在线转换站时。

什么时候别用

需要服务端集成、大规模批处理,或有认证合规要求的专业工具时。

隐私说明

工具输入仅在浏览器本地处理。主题/语言/收藏可能使用 localStorage;托管可能保留常规访问日志(IP、UA、URL),不含工具正文。

常见问题(5)

Which dialects?

Use the dialect option (e.g. sql, mysql, postgresql, bigquery) for better keyword layout.

Will my query be sent to a server?

Never. Formatting runs with the self-hosted sql-formatter bundle.

Does it execute SQL?

No—it only beautifies text. There is no database connection.

Can it minify SQL?

Beautify is the primary mode; remove comments/whitespace manually if you need extreme compaction.

Large scripts?

Typical stored-proc sizes are fine; multi-megabyte dumps may slow the tab.