SQL Formatter

Web · Windows · Mac · Linux · Extension

Freedom report

Three barsScore 6.6

  • Free tierA free tier is on its own pricing page
  • Open codeNo open-source code on record
  • Runs widely4 of 6 device platforms
  • DocumentedPlans, terms and facts published

SQL Formatter is a free, MIT-licensed JavaScript library that makes SQL queries easier to scan by applying configurable formatting. Options cover indentation, capitalization of keywords, data types, functions and identifiers, logical operator placement, expression width, spacing between queries, and operator spacing. It supports dialects including BigQuery, ClickHouse, DB2, DuckDB, Hive, MariaDB, MySQL, TiDB, Couchbase N1QL, Oracle PL/SQL, PostgreSQL, Redshift, SingleStoreDB, Snowflake, Spark, SQL Server Transact-SQL, and Trino/Presto. The command-line tool reads SQL from standard input or a file and can print formatted output or update the file in place. The project also offers VS Code and Vim extensions, a Prettier plugin, and an ESLint integration. A JSON Schema helps editors provide configuration-file completion and IntelliSense. The formatter can substitute prepared-statement placeholders when parameter values are supplied, and a browser demo exposes formatting controls. It does not handle stored procedures or delimiter changes, and templating support is limited to a workaround. Its maintainer says the project is in maintenance mode.

Who it is for

It suits developers who want configurable SQL formatting in a command-line workflow, browser demo, or supported editor integration. Its dialect coverage is useful for work across the listed SQL systems.

What is good

  • Free and released under the MIT license.
  • Supports a wide range of SQL dialects.
  • CLI can update a file in place.
  • Offers VS Code and Vim extensions.
  • Can replace placeholders with supplied values.

What to know first

  • Stored procedures are not supported.
  • Delimiter changes from semicolons are unsupported.
  • Templating syntax is not directly supported.
  • Maintainer says new features are unlikely.

Freedom251 review

SQL Formatter: the full review

SQL Formatter offers broad dialect coverage and several ways to apply consistent query formatting. Its limitations around stored procedures, delimiters, and templates matter for projects that rely on those constructs.

Overview

SQL Formatter is a free JavaScript library for making SQL queries more consistent to read. It suits developers who want configurable formatting in scripts, editors, or a browser demo. Its breadth and MIT license are appealing, but its maintenance mode and gaps around procedures, delimiters, and templates narrow its fit.

Key features

Dialect support spans Standard SQL, BigQuery, ClickHouse, DB2 and DB2i, DuckDB, Hive, MariaDB, MySQL, TiDB, Couchbase N1QL, Oracle PL/SQL, PostgreSQL, Redshift, SingleStoreDB, Snowflake, Spark, SQLite, SQL Server Transact-SQL, and Trino/Presto. That range makes it useful for teams working across different SQL systems. Dialect coverage does not extend to stored procedures, however, and the formatter cannot change the semicolon delimiter.

Formatting controls include indentation; case for keywords, data types, functions, and identifiers; logical-operator placement; expression width; spacing between queries; and operator spacing. A browser demo provides controls for language, indentation, case, operator newlines, expression width, and query spacing. Prepared-statement placeholders can be replaced using supplied parameter values.

The CLI reads SQL from standard input or a file, then prints formatted output or updates the file in place. Integrations include VS Code and Vim extensions, a Prettier plugin, and an ESLint plugin. A JSON Schema enables configuration-file autocompletion and IntelliSense, with usage guides for VS Code and Zed. These routes make it practical to apply a shared style in several workflows, while the maintainer's maintenance-mode position—feasible bug fixes, but likely no new features—makes it less suitable for projects counting on ongoing feature development.

Templating syntax is not directly supported. A parameter-type workaround may help with some templates, but it may not cover every construct, so templated SQL can require another approach.

Pricing

The Free plan costs 0.00 USD per free and includes the SQL formatting library and browser demo. The software is MIT-licensed and open source, with automatic fixes, editor extensions, and configuration-file support. There is no paid tier or trial to weigh against it; it is a straightforward fit for individual developers and teams seeking a no-cost formatter, though the maintenance and syntax limits still apply.

Platforms

SQL Formatter is available as an extension and for Linux, macOS, Windows, and the web. The CLI also supports standard-input and file-based workflows.

Who it's for

Choose SQL Formatter when you need a free, configurable formatter across multiple SQL dialects and value editor, CLI, or browser use. Look elsewhere if stored procedures, custom delimiters, broad template handling, or a continuing stream of new features are central to your workflow.

Pros and cons

  • Pros: Broad dialect support helps teams standardize formatting across varied SQL projects.
  • Pros: Multiple formatting controls, editor integrations, CLI, and browser demo provide flexible ways to apply a style.
  • Pros: The MIT license and free plan remove purchase cost.
  • Cons: Stored procedures and custom delimiters are unsupported, limiting use with those SQL constructs.
  • Cons: Templates are not directly supported, and the workaround may not handle every construct.
  • Cons: Maintenance mode means new features are unlikely.

Alternatives

For another free formatter, compare Sqruff, which supports extension, Linux, macOS, self-hosted, web, and Windows platforms. JSQLFormatter is another free option for Linux, macOS, self-hosted, and Windows. Choose Poor SQL if its online and offline formatting or SSMS/Visual Studio plugin is a better match; it is free and open-source under AGPL.

Sleek is a free, open-source formatter for extension, Linux, macOS, and Windows. sqlfmt offers a free browser formatter that runs via WebAssembly without installation. TSQLLint is free MIT-licensed software installable with dotnet-tool, Homebrew, or NPM. pgFormatter is free software distributed under the PostgreSQL Licence, while SQLint is a free MIT-licensed Python package with a Standard SQL (BigQuery) parser and linter. Browse SQL Linters and Formatters for more options.

Verdict

SQL Formatter is a strong no-cost choice for developers who want broad dialect coverage and several ways to enforce consistent query style. Its chief trade-off is a constrained future and missing support for procedures, delimiter changes, and direct templating; projects that depend on those constructs should choose another tool.

SQL Formatter plans and pricing

All plans
Free Free SQL formatting library and browser demo · MIT licensed github.com · 4 Oct 2026

Compared on SQL linters and formatters

Supported SQL dialects
Standard SQL, BigQuery, ClickHouse, IBM DB2, IBM DB2i, DuckDB, Apache Hive, MariaDB, MySQL, TiDB, Couchbase N1QL, Oracle PL/SQL, PostgreSQL, Amazon Redshift, SingleStoreDB, Snowflake, Spark, SQLite, SQL Server Transact-SQL, Trino/Presto
Automatic fixes
Yes
Editor extensions
Yes
Configuration file
Yes

Best SQL Formatter alternatives

See all 20