SQL Formatter

Beautify and format SQL statements with proper indentation, keyword capitalization, and dialect-specific formatting for MySQL, PostgreSQL, and SQLite.

Writing SQL by hand or copying it from logs often produces a single long line that is nearly impossible to read. A properly formatted SQL statement with aligned keywords, consistent indentation, and uppercased reserved words can cut debugging time dramatically — especially for complex queries with multiple JOINs, subqueries, or CTEs.

This formatter runs entirely in your browser and supports the most common SQL dialects: MySQL, PostgreSQL, and SQLite. It handles SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, and more. Paste your messy SQL, pick your dialect, and get clean output instantly with no server round-trip.