Skip to content
SPECIFICTION
Get listed

JSQLFormatter vs sqlfmt

JSQLFormatter

manticore-projects.com

sqlfmt

github.com

Side by side

FigureJSQLFormattersqlfmt
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
Web—Yes
WindowsYes—
macOSYes—
LinuxYesYes
API—Yes
Self-hostedYesYes
Plans published11
Spec score · SQL Linters and Formatters8.3 (#5)8.5 (#3)
LicenseJSQLFormatter is licensed under Apache 2.0 from version 5.4 onwards; releases through 5.3 were AGPL.sqlfmt is distributed under the PostgreSQL Licence.
PurposeJSQLFormatter is a platform independent SQL formatter, beautifier and pretty printer.sqlfmt is a gofmt-style command-line formatter for PostgreSQL SQL.

Plans

JSQLFormatter

  • JSQLFormatterFree

JSQLFormatter pricing →

sqlfmt

  • Browser formatterFree

sqlfmt pricing →

In their own words

JSQLFormatter

JSQLFormatter formats SQL for terminal output, documents, and wikis, and is available as a Java library or command-line executable. It parses SQL with a grammar into an abstract syntax tree rather than relying on regular expressions. Supported statements include SELECT, INSERT, MERGE, UPDATE, DELETE, CREATE, and ALTER, including WITH clauses and nested sub-selects. The listed dialects cover Oracle, SQL Server, MySQL, MariaDB, PostgreSQL, H2, DuckDB, BigQuery, Redshift, Databricks, and Snowflake. Formatting can preserve comments between keywords or within join conditions, while leaving comment-like string literals unchanged. Users can configure indentation, comma placement, and the casing of keywords, functions, and objects, with settings applied per invocation, file, or statement. Output options include ANSI terminal highlighting, HTML, and RTF. A Java-source feature imports SQL strings while retaining variables and can export them as String, StringBuilder, or MessageFormat. JSQLFormatter is free. Its license is Apache 2.0 from version 5.4 onward; releases through 5.3 were AGPL. A NetBeans plugin is a platform target, while Eclipse, JEdit, Squirrel SQL, and DBeaver are listed as planned.

Visit manticore-projects.com

sqlfmt

sqlfmt is a free formatter for PostgreSQL SQL, available as a command-line tool and as a browser formatter running through WebAssembly. Its river-aligned style pads clause keywords so they share a column. The CLI reads SQL from files or stdin and writes formatted SQL to stdout; it can also rewrite files in place, list files needing changes, and show unified diffs. Its explain subcommand formats PostgreSQL plan text and can provide advice, canonicalized output, or structural comparisons. Plan advice describes join order, join and access methods, and parallelism, without costs, row estimates, or timing. The explain diff operation returns exit code 0 for structurally identical plans and 1 when structures differ, so it can be used in scripts and CI. A Go subpackage provides formatting for Go programs, and the project includes Emacs and Vim integrations. The browser build exposes formatting and version functions to JavaScript. Deeply nested subqueries and less common upsert or DDL forms remain best-effort areas. sqlfmt is intended for standalone formatting and SQL used in The Art of PostgreSQL book and courses.

Visit github.com