SQL Formatter & Beautifier
Format & beautify SQL for many dialects — Postgres, MySQL, SQLite & more.
Format and beautify SQL queries with proper indentation and keyword casing across dialects. Free SQL beautifier that runs entirely in your browser.
About SQL Formatter & Beautifier
SQL Formatter & Beautifier is a free, browser-based tool that re-indents and reformats messy or minified SQL into clean, readable code, with keyword casing and indentation tailored to your database dialect. It supports 12 dialects including PostgreSQL, MySQL, MariaDB, SQLite, BigQuery, Snowflake, Redshift, T-SQL, PL/SQL, Spark, Trino and standard SQL. Formatting runs entirely in your browser — your queries are never uploaded — and there is no signup.
How to use SQL Formatter & Beautifier
- Paste or type your SQL into the left input box — it formats live as you type, no button to press.
- Pick your database dialect (Standard, PostgreSQL, MySQL, MariaDB, SQLite, BigQuery, Snowflake, Redshift, T-SQL, PL/SQL, Spark, or Trino).
- Choose a keyword case — UPPER, lower, or Preserve — and set the indent width (1 to 8 spaces).
- Read the formatted result in the right pane, where the Input, Output, Lines, and Dialect stats update as you edit.
- Click Copy to copy the formatted SQL, or Download to save it as formatted.sql.
Frequently asked questions
- Is it free?
- Yes. The SQL Formatter is completely free with no signup, no account, and no usage limits.
- Are my queries uploaded to a server?
- No. Everything runs locally in your browser using the sql-formatter library — your SQL never leaves your device and nothing is sent over the network.
- Which SQL dialects are supported?
- Twelve dialects: Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, BigQuery, Snowflake, Redshift, T-SQL (Transact-SQL), PL/SQL, Spark, and Trino. Choosing the right one applies dialect-aware keyword and indentation rules.
- Can I control the indentation and keyword casing?
- Yes. Set keyword case to UPPER, lower, or Preserve, and choose an indent width from 1 to 8 spaces. Changes apply to the output instantly.
- What happens if my SQL has a syntax error?
- The formatter parses your input and shows an error message for genuinely unparseable SQL, such as an unclosed string or block comment. Fix the flagged issue and it formats again automatically.
- Is there a size limit?
- Input is capped at 500 KB, which is far larger than any hand-written query. Beyond that the tool asks you to trim the input so live formatting stays responsive.
People also search for
SQL Formatter & Beautifier is also known as sql formatter, format sql online, beautify sql query, sql pretty printer, postgres sql formatter, mysql query formatter, clean up sql code.