DevFmt/

SQL Formatter

Dialect:
Case:
Indent:
Input — SQL
Output — Formatted SQL

How to use SQL Formatter

SQL Formatter beautifies SQL queries with proper indentation, keyword formatting, and dialect-aware syntax handling. Supports Standard SQL, PostgreSQL, MySQL, and SQLite.

Paste any SQL query — from simple SELECTs to complex multi-table JOINs with subqueries — and get clean, readable output instantly. Configure keyword casing (UPPER, lower, or as-is) and indentation (2 or 4 spaces) to match your team's style guide.

Key features: 4 SQL dialect modes, configurable keyword casing, adjustable indentation, support for complex queries (JOINs, CTEs, subqueries, window functions), one-click copy, and download.

All formatting runs locally in your browser using the sql-formatter library. Your queries are never sent to any server — safe for formatting production SQL containing table names, column names, or sensitive query patterns.

FAQ

How do I format SQL online?
Paste your SQL query into the input panel. DevFmt formats it with proper indentation and keyword uppercasing. Choose your SQL dialect (Standard, PostgreSQL, MySQL, SQLite) for accurate formatting.
What SQL dialects are supported?
Standard SQL, PostgreSQL, MySQL, and SQLite. Each dialect handles its specific syntax and keywords correctly.
Can I control keyword casing?
Yes. Choose between UPPER case (default), lower case, or preserve the original casing of SQL keywords.
Does it handle complex queries?
Yes. The formatter handles JOINs, subqueries, CTEs (WITH clauses), window functions, UNION, and other complex SQL constructs.

We use cookies for anonymous analytics and ads. Your tool data never leaves your browser.