SQL 格式化工具 — Uttir
Skip to main content

SQL 格式化工具

美化 MySQL、PostgreSQL、SQLite 等数据库的 SQL 查询语句,支持关键字大写和 Tab 缩进。

SQL 格式化工具 — Minified or hand-written SQL is hard to read and easy to get wrong. A few seconds of formatting turns a dense one-liner into a clearly indented, skimmable query that you can debug, review, and share with confidence.

Your SQL is formatted entirely in your browser. The query never leaves this page.

Was SQL 格式化工具 useful?

SQL 格式化工具是什么?

Minified or hand-written SQL is hard to read and easy to get wrong. A few seconds of formatting turns a dense one-liner into a clearly indented, skimmable query that you can debug, review, and share with confidence.

This formatter understands the grammar of the major SQL dialects — MySQL, PostgreSQL, SQLite, MariaDB, BigQuery, and T-SQL — so keywords, joins, and subqueries are indented correctly for each. The entire formatting step runs in your browser; your queries stay private.

使用方法

  1. Paste your SQL

    Any query, however messy — the formatter handles one-liners and minified code.

  2. Pick your dialect

    Select the database flavor so reserved words and syntax are handled correctly.

  3. Tune and copy

    Toggle keyword uppercase or tab indentation, then copy the cleaned query.

示例

A messy one-liner becomes readable

Formatting separates the columns, tables, and conditions onto their own lines.

select id,name from users where id=1 and active=true order by name desc

结果: SELECT id, name FROM users WHERE id = 1 AND active = true ORDER BY name DESC

常见问题

相关指南

相关工具

Last reviewed: 2026-11-21