Uttir

SQL Formatter

Format and beautify SQL queries for MySQL, PostgreSQL, SQLite, and more — with optional keyword uppercase and tab indentation.

SQL Formatter — 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.

What is sql formatter?

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.

How to use it

  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.

Examples

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

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

Frequently asked questions

Related tools