Freedom251 › Relational Databases
H2 Database Engine

What H2 Database Engine is
H2 Database Engine is a free SQL database written in Java, founded in 2004. It supports embedded, server, and mixed modes, with databases stored on disk or held in memory. H2 supports standard SQL and JDBC; server mode also allows JDBC or ODBC connections over TCP/IP. Its browser-based Console includes autocomplete, and its feature list includes transactions, multi-version concurrency, and row-level locking. Compatibility modes are listed for IBM DB2, Apache Derby, HSQLDB, MS SQL Server, MySQL, Oracle, and PostgreSQL. Database files can be encrypted with AES-128, and remote JDBC connections can use TLS. H2 is dual licensed under MPL 2.0 or EPL 1.0, and its license information says it can be integrated into and distributed with commercial applications. The home page describes the JAR file as around 2.5 MB and lists a Windows installer and an all-platforms ZIP. Its security guidance warns against exposing an H2 server to untrusted connections and says it is not designed for adversarial environments.
Who it suits
H2 may suit developers seeking a Java SQL database with embedded and server modes, or a database for integration into commercial applications. Its security warning matters for anyone considering network exposure.
What it does well
- Free to use, with source code included.
- Supports embedded, server, and mixed modes.
- Offers a browser-based Console with autocomplete.
- Dual licensed under MPL 2.0 or EPL 1.0.
What to know first
- Not designed for adversarial environments.
- Guidance warns against untrusted server connections.
- Remote JDBC TLS is listed; no broader security claim is given.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| H2 Database Engine | Free to use for everybody · source code included | Free |
As h2database.com lists them, read 2 Oct 2026. The maker's own page has the final word.
Getting started
- Visit the H2 Database Engine website.
- Download the Windows installer or the all-platforms ZIP.
- Choose embedded, server or mixed mode for your database.
- Choose disk-based or in-memory storage.
- Use the browser Console, or connect with JDBC; in server mode, JDBC and ODBC connections over TCP/IP are supported.
H2 Database Engine is a compact, Java-based SQL database for developers who need the same free engine in embedded, server, or mixed deployments. It is particularly well suited to Java applications, local tools, prototypes, and controlled internal services where a small footprint and broad SQL compatibility matter.
Overview
H2 is free to use, includes its source code, and is dual licensed under MPL 2.0 or EPL 1.0. The licensing terms allow integration into and distribution with commercial applications, making it practical for both open and proprietary products. Its roughly 2.5 MB JAR keeps the database easy to package when a full external database service would be excessive.
Deployment is unusually flexible for a lightweight engine. You can run H2 inside an application, as a standalone server, or in a mixed arrangement, with data kept on disk or in memory. That breadth benefits teams moving between tests, desktop software, and controlled services, but it also means deployment security must be handled carefully.
Key features
- Multiple database modes: Embedded, server, and mixed modes let an application choose between in-process access and a separate service. Disk-based storage suits persistence, while in-memory databases suit temporary or fast-running workloads.
- SQL connectivity: H2 supports standard SQL and JDBC. Server mode adds JDBC and ODBC connections over TCP/IP, which broadens client compatibility beyond Java applications.
- Browser console: The included web Console has autocomplete, giving developers a direct way to inspect and work with databases without a separate administration application.
- Concurrency controls: Transactions, multi-version concurrency, and row-level locking provide the mechanisms needed when multiple operations must remain consistent.
- Compatibility modes: Modes are provided for IBM DB2, Apache Derby, HSQLDB, Microsoft SQL Server, MySQL, Oracle, and PostgreSQL. They can ease migration or development against familiar SQL behavior, but they do not turn H2 into a drop-in equivalent for every feature of those systems.
- Encryption and transport security: Database files can use AES-128 encryption, and remote JDBC connections can use TLS. These protections help protect stored data and network traffic, but they do not remove the need for a properly isolated deployment.
- JSON and availability: H2 lists JSON data support and high availability, useful considerations for applications that need those capabilities alongside a free engine.
The project explicitly warns that H2 is not designed for adversarial environments and advises against exposing an H2 server to untrusted connections. H2 is therefore a better fit behind application controls or on trusted networks than as a directly exposed public database endpoint.
Pricing
H2 Database Engine — free. The single plan is free to use for everybody and includes the source code. There is no paid tier, seat charge, quota, or trial conversion to weigh, so it works for individual developers, commercial teams, and distributable software alike. The trade-off is that the project does not present a paid support package in this offer; support is directed to Stack Overflow and a Google Group.
Platforms
H2 supports API, Linux, macOS, self-hosted, web, and Windows environments. The project provides a Windows installer and an all-platforms ZIP download. Its Java foundation and small JAR make self-hosted and application-embedded deployment the natural choices, while the web Console supplies browser access for administration.
Who it's for
Choose H2 for Java software, desktop utilities, test and development environments, embedded products, or trusted internal services that need SQL, transactions, and flexible deployment without a license bill. Its compatibility modes can help teams familiar with major relational systems, and its in-memory option is useful when persistence is not required.
Look elsewhere for a database intended to face hostile or unknown network clients, or when you need a managed cloud service with explicit usage quotas and operational support. H2's security warning makes network exposure a design constraint rather than a minor configuration detail.
Pros and cons
Pros
- Free with source included: commercial distribution is permitted under MPL 2.0 or EPL 1.0.
- Flexible deployment: embedded, server, mixed, disk-based, and in-memory modes cover varied application designs.
- Small footprint: an approximately 2.5 MB JAR is well suited to lightweight packaging.
- Strong SQL tooling: standard SQL, JDBC, ODBC-over-TCP/IP, and a browser Console with autocomplete support development and administration.
- Useful protections: AES-128 file encryption and TLS for remote JDBC connections are included.
Cons
- Unsafe for untrusted exposure: the project advises against exposing an H2 server to untrusted connections, limiting its role as a public-facing database service.
- Compatibility is not identity: compatibility modes may ease porting but cannot guarantee behavior identical to the named database products.
- Community support route: users are directed to Stack Overflow and a Google Group rather than a listed paid support plan.
Alternatives
SQLite is the stronger pick when you want a free embedded engine with no separate server process and broad mobile and desktop platform coverage.
Azure SQL Database suits teams that prefer a managed cloud service, with a free offer including 100,000 vCore seconds, 32 GB of data storage, 32 GB of backup storage, and 10 databases per subscription.
InterSystems IRIS is worth considering when a commercial database platform with a free Community Edition and free trial better matches your requirements.
MySQL is an alternative for teams seeking a widely deployed relational engine with a free Community Edition and optional paid offerings.
HSQLDB provides another lightweight SQL option, while its Developer subscription costs $100 a year for priority support and input into future development.
Microsoft SQL Server is the alternative for organizations committed to Microsoft's ecosystem and edition-based licensing.
Neon is a cloud-oriented choice with a free tier covering 10 projects, 50 CU-hours per month per project, 0.5 GB storage per project, 10 branches per project, and 5 GB monthly egress.
C++Builder is a development tool rather than a direct database-engine substitute.
Verdict
H2 Database Engine is a strong choice for developers who want a free, compact SQL engine that can move between embedded, in-memory, and controlled server deployments, especially in Java software. Choose it for that flexibility, licensing freedom, and practical SQL tooling; choose another product when your database must safely accept untrusted Internet connections or when you need managed cloud operations and formal support.
Verdict
H2 offers several deployment modes, SQL interfaces, and compatibility modes without a listed price. Its explicit caution about untrusted connections should shape deployment decisions.
Questions
How much does H2 Database Engine cost?
The plan is listed as free, and H2 is free to use for everybody.
Is H2 open source?
H2 includes source code and is dual licensed under MPL 2.0 or EPL 1.0. Its license terms allow integration into and distribution with commercial applications.
Which operating systems and deployment options are listed?
Platforms include Linux, macOS and Windows, as well as API, web and self-hosted. H2 supports embedded, server and mixed modes.
Can H2 connect over JDBC or ODBC?
H2 supports standard SQL and JDBC. In server mode, JDBC or ODBC connections can use TCP/IP.
What downloads are available?
The home page lists a Windows installer and an all-platforms ZIP download.
Is H2 suitable for connections from untrusted users?
H2 says it is not designed for adversarial environments and advises against exposing an H2 server to untrusted connections.
Facts from H2 Database Engine's own pages
- Compatibility
- Compatibility modes are listed for IBM DB2, Apache Derby, HSQLDB, MS SQL Server, MySQL, Oracle, and PostgreSQL. · h2database.com, 2 Oct 2026
- Database modes
- It supports embedded, server, and mixed modes, with disk based or in memory databases. · h2database.com, 2 Oct 2026
- Downloads
- The home page lists a Windows installer and an all platforms ZIP download. · h2database.com, 2 Oct 2026
- Encryption
- The feature list says database files can be encrypted with AES-128 and remote JDBC connections can use TLS. · h2database.com, 2 Oct 2026
- Footprint
- The home page describes a small footprint of around 2.5 MB for the JAR file. · h2database.com, 2 Oct 2026
- Founded
- 2004 · h2database.com, 23 Sept 2026
- Free plan
- Yes · h2database.com, 22 Sept 2026
- License
- H2 is dual licensed under MPL 2.0 or EPL 1.0, and the license page says it can be integrated into and distributed with commercial applications. · h2database.com, 2 Oct 2026
- Purpose
- H2 is a free SQL database written in Java. · h2database.com, 2 Oct 2026
- Security
- The security page warns that H2 is not designed for adversarial environments and advises against exposing an H2 server to untrusted connections. · h2database.com, 2 Oct 2026
- SQL and APIs
- H2 supports standard SQL and JDBC, and server mode supports JDBC or ODBC over TCP/IP. · h2database.com, 2 Oct 2026
- Support
- The home page directs users to Stack Overflow and a Google Group for support. · h2database.com, 2 Oct 2026
- Transactions
- The feature list includes transaction support, multi version concurrency, and row level locking. · h2database.com, 2 Oct 2026
- Web console
- H2 includes a browser based Console application with autocomplete. · h2database.com, 2 Oct 2026
Where H2 Database Engine stands on Freedom251
- Relational Databases#8 of 38
- Embedded Databases#8 of 30
- Sql Databases#7 of 23
- Database Software#44 of 74