Skip to content

SQL Formatter

Format SQL for various dialects, adjust keyword case and indentation, or minify the code.

Loading tool…

Runs locally in your browser. Your files are never uploaded.

About this tool

SQL code often looks messy when copied from different sources or edited without a style guide. This tool reformats queries for many dialects such as MySQL, PostgreSQL, SQLite, T-SQL and BigQuery, lets you set keyword capitalization and indentation style, and can also compress the script to a single line, helping you keep scripts clean and readable.

How to use it

  1. Paste your SQL query into the text box.
  2. Select the target dialect and formatting options you need.
  3. View the formatted result and copy or download it.