SQL Formatter

Format and beautify SQL queries online for free. Supports multiple dialects with adjustable indentation. Runs privately in your browser.

Ready.

How to use the SQL Formatter

  1. Paste your SQL query into the input box (or click Load sample to try one).
  2. Pick your database dialect, indentation width, and keyword case.
  3. Click Format — your query is beautified instantly with consistent indentation.
  4. Use Copy to grab the tidy SQL for your editor, migration, or pull request.

Frequently asked questions

Which SQL dialects are supported?
Standard SQL, MySQL, PostgreSQL, MariaDB, SQLite, BigQuery, and Transact-SQL (SQL Server). Choosing the right dialect improves how keywords and syntax are formatted.
What does “keyword case” do?
Preserve keeps your keywords as-is, UPPER forces them uppercase (e.g. SELECT, FROM), and lower makes them lowercase. Only reserved keywords are affected — your table and column names are untouched.
Will it change my query’s meaning?
No. Formatting only adjusts whitespace, indentation, and keyword casing. The logic and results of your query stay exactly the same.
Is my SQL sent to a server?
No. Formatting runs entirely in your browser using JavaScript. Your queries never leave your device — safe for production and proprietary schemas.