- Home
- SQL Linters and Formatters
- JSQLFormatter
JSQLFormatter
What it is
JSQLFormatter is a platform-independent SQL formatter that parses SQL into an abstract syntax tree using a grammar, then produces formatted output. It handles SELECT, INSERT, MERGE, UPDATE, DELETE, CREATE and ALTER statements, including WITH clauses and nested sub-selects. Listed database dialects include Oracle, SQL Server, MySQL, MariaDB, PostgreSQL, H2, DuckDB, BigQuery, Redshift, Databricks and Snowflake. The formatter preserves comments, including those between keywords or inside join conditions, and does not treat comment-like string literals as comments. Users can configure indentation, comma placement and the casing of keywords, functions and objects, applying settings per invocation, file or statement. Output includes ANSI terminal highlighting and HTML or RTF for documents and wikis. A Java source feature imports SQL strings while retaining variables and can export them as String, StringBuilder or MessageFormat. JSQLFormatter is available as a Java library JAR from Maven Central and an executable JAR for command-line use. It is free; version 5.4 onward is licensed under Apache 2.0, while releases through 5.3 used AGPL.
For and against
For
- Supports a broad set of listed SQL dialects.
- Preserves comments and leaves comment-like literals alone.
- Offers configurable formatting settings.
- Available as a Java library and command-line JAR.
- Free under Apache 2.0 from version 5.4.
Against
- Native dynamic libraries are marked coming soon.
- Eclipse, JEdit, Squirrel SQL and DBeaver integrations are planned.
- Releases through 5.3 used AGPL.
The verdict
JSQLFormatter offers SQL formatting with dialect coverage, configurable output and comment preservation. Check the license applicable to the version in use, since earlier releases used AGPL.
Who it suits
JSQLFormatter suits developers who need to format SQL across the listed dialects or preserve SQL comments during formatting. Java users can choose its library or command-line JAR.
Plans and prices
JSQLFormatter
Apache 2.0 licensed from version 5.4; available as Java library and command-line executable
Read 4 Oct 2026 · manticore-projects.com
On the record
- Comments
- It preserves comments, including comments between keywords or inside join conditions, and leaves comment-like string literals alone.manticore-projects.com · read 4 Oct 2026
- Configuration
- Indent width, comma placement, and keyword, function and object casing can be configured per invocation, file or statement.manticore-projects.com · read 4 Oct 2026
- Database coverage
- The site lists Oracle, SQL Server, MySQL, MariaDB, PostgreSQL, H2, DuckDB, BigQuery, Redshift, Databricks and Snowflake.manticore-projects.com · read 4 Oct 2026
- IDE integrations
- The site says a NetBeans plugin is a platform target and lists Eclipse, JEdit, Squirrel SQL and DBeaver as planned.manticore-projects.com · read 4 Oct 2026
- Interfaces
- The product is offered as a Java library JAR from Maven Central and as an executable JAR for command-line use.manticore-projects.com · read 4 Oct 2026
- Java source
- It can import SQL strings from Java source while preserving variables and export them as String, StringBuilder or MessageFormat.manticore-projects.com · read 4 Oct 2026
- License
- JSQLFormatter is licensed under Apache 2.0 from version 5.4 onwards; releases through 5.3 were AGPL.manticore-projects.com · read 4 Oct 2026
- Maker
- Manticore Projects describes itself as a consulting company for financial valuation, reporting and credit risk management.manticore-projects.com · read 4 Oct 2026
- Native libraries
- The installation page labels native dynamic libraries as “Coming soon.”manticore-projects.com · read 4 Oct 2026
- Output formats
- It supports ANSI terminal highlighting and HTML and RTF output for documents and wikis.manticore-projects.com · read 4 Oct 2026
- Parsing
- It parses SQL into an abstract syntax tree using a real grammar rather than regular expressions.manticore-projects.com · read 4 Oct 2026
- Purpose
- JSQLFormatter is a platform independent SQL formatter, beautifier and pretty printer.manticore-projects.com · read 4 Oct 2026
- Security and privacy
- The product page describes local Java and command-line use but does not state a security certification or compliance claim.manticore-projects.com · read 4 Oct 2026
- Statement coverage
- It supports SELECT, INSERT, MERGE, UPDATE, DELETE, CREATE and ALTER statements, including WITH clauses and nested sub-selects.manticore-projects.com · read 4 Oct 2026