About SQL Formatter
SQL Formatter is a free, browser-based tool built to help developers, analysts, and database administrators write cleaner, more readable SQL — instantly and privately, with no sign-up required.
What We Built
Raw SQL is often written under time pressure — long queries, deeply nested subqueries, no indentation, inconsistent casing. The goal of this tool is simple: take messy SQL and make it readable in one click.
The toolset includes a SQL Formatter for beautifying queries, a SQL Minifierfor compressing them, and a SQL Diff viewer for comparing two versions side by side. All three tools run entirely in your browser using JavaScript — nothing is sent to any server.
Dialect Support
Not all SQL is the same. We support over 20 dialects out of the box, including MySQL, PostgreSQL, Oracle PL/SQL, SQL Server (T-SQL), Snowflake, Google BigQuery, ClickHouse, Amazon Redshift, Databricks, Trino, Apache Spark SQL, Apache Hive, SQLite, DuckDB, and more. Each dialect is handled with its own parser rules to ensure vendor-specific syntax is formatted correctly.
Privacy First
Your SQL queries never leave your browser. There is no backend, no query logging, no analytics, and no tracking scripts. The only data stored on your device is your theme preference (light or dark mode), which is saved in localStorage and can be cleared at any time.
Open Source Technology
This tool is built on top of excellent open-source projects:
- sql-formatter — the MIT-licensed SQL parsing and formatting engine that powers the core formatter logic
- CodeMirror 6 — the editor framework providing syntax highlighting, line numbers, and keyboard shortcuts
- Astro — the MPA framework used to build and deploy the site as fast, lightweight HTML pages
- Geist — Vercel's design system for fonts and visual tokens
Formatting Options
The formatter is fully configurable. Every team has a different SQL style guide — some prefer 2-space indentation, others prefer tabs; some write keywords in uppercase, others in lowercase. TheOptions panel lets you configure indent width, keyword case, function case, data type case, identifier case, indent style, line width, logical operator placement, and lines between queries.
Who Is It For?
- Developers — format ad-hoc queries before committing to a codebase
- Data analysts — clean up BI tool–generated SQL for readability
- DBAs — standardise SQL style across a team using the options panel
- Students — learn proper SQL structure and formatting conventions
- Code reviewers — use the SQL Diff to compare query versions before approving a PR
Contact & Feedback
Have a feature request, found a bug, or want to get in touch? Visit ourContact page — we'd love to hear from you.