Freedom251 › SQL Linters and Formatters
SQL Formatter

What SQL Formatter is
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 suits
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 it does well
- 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.
Limits
The formatter does not support stored procedures or delimiter changes from a semicolon. Templating syntax is not directly supported, and the described parameter workaround may not cover every templating construct.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| Free | SQL formatting library and browser demo · MIT licensed | Free |
As sql-formatter-org.github.io lists them, read 4 Oct 2026. The maker's own page has the final word.
Getting started
- Visit https://sql-formatter-org.github.io/sql-formatter/
- Use the browser demo to choose formatting options
- Use the command-line tool with SQL from standard input or a file
- Install a listed VS Code or Vim extension if you want editor integration
- Use the JSON Schema for configuration-file completion in supported editors
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 nothing 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.
Verdict
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.
Questions
Is SQL Formatter free?
Yes. The Free plan costs nothing and includes the SQL formatting library and browser demo. The software is MIT licensed.
Which SQL dialects does it support?
Supported dialects include 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.
Can SQL Formatter work from the command line?
Yes. Its CLI accepts SQL from standard input or a file and can output formatted SQL or update a file in place.
Does it integrate with code editors?
The project lists VS Code and Vim extensions, a Prettier plugin, and an ESLint integration. It also provides a JSON Schema for configuration completion and IntelliSense, with guides for VS Code and Zed.
Can it format stored procedures or templated SQL?
Stored procedures are unsupported. Templating syntax is not directly supported; the described parameter-type workaround may not cover every templating construct.
Is SQL Formatter actively adding features?
The maintainer says the project is in maintenance mode, with feasible bug fixes and likely no new features.
Facts from SQL Formatter's own pages
- Browser demo
- The official demo page exposes controls for language, indentation, case, operator newlines, expression width, and query spacing. · sql-formatter-org.github.io, 4 Oct 2026
- CLI
- The command line tool accepts SQL from standard input or a file and can write formatted output or update a file in place. · github.com, 4 Oct 2026
- Configuration schema
- The project provides a JSON Schema for configuration-file autocompletion and IntelliSense in editors, with usage guides for VS Code and Zed. · github.com, 4 Oct 2026
- Dialects
- It supports 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. · github.com, 4 Oct 2026
- Editor integrations
- The project lists VS Code and Vim extensions, a Prettier plugin, and an ESLint plugin integration. · github.com, 4 Oct 2026
- Formatting options
- Options include indentation, keyword and data type case, function and identifier case, logical operator placement, expression width, spacing between queries, and operator spacing. · github.com, 4 Oct 2026
- License
- The software is released under the MIT license. · github.com, 4 Oct 2026
- Limits
- It does not support stored procedures or changing the delimiter from a semicolon. · github.com, 4 Oct 2026
- Maintenance
- The maintainer says the formatter is in maintenance mode, with feasible bug fixes and likely no new features. · github.com, 4 Oct 2026
- Placeholder replacement
- The library can replace placeholders in prepared SQL statements using supplied parameter values. · github.com, 4 Oct 2026
- Purpose
- SQL Formatter is a JavaScript library for pretty-printing SQL queries. · github.com, 4 Oct 2026
- Templating
- Templating syntax is not directly supported; the README describes a parameter-type workaround that may not cover every templating construct. · github.com, 4 Oct 2026
Where SQL Formatter stands on Freedom251
- SQL Linters and Formatters#10 of 26
