H2 Database Engine
H2 Database Engine is a free SQL database written in Java.
What H2 Database Engine is
H2 Database Engine is a free SQL database written in Java. It supports embedded, server and mixed modes, with databases stored on disk or kept in memory. H2 works with standard SQL and JDBC; server mode also accepts JDBC or ODBC connections over TCP/IP. Its browser-based Console includes autocomplete, and listed database features include transactions, multi-version concurrency and row-level locking. Compatibility modes cover 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 the license permits integration into and distribution with commercial applications. The home page describes its JAR file as around 2.5 MB and lists a Windows installer and an all-platforms ZIP. H2 warns that it is not designed for adversarial environments and advises against exposing its server to untrusted connections. Support is directed to Stack Overflow and a Google Group.
Good
- Supports embedded, server and mixed modes
- Provides JDBC and standard SQL support
- Offers AES-128 file encryption and TLS connections
- Dual licensed under MPL 2.0 or EPL 1.0
Watch out
- Not designed for adversarial environments
- H2 advises against untrusted server connections
- Support is directed to community forums
Who it suits
H2 may suit developers seeking a Java SQL database for embedded or server use, including projects that need disk-based or in-memory storage. Its security guidance is important for anyone considering network-accessible server use.
Verdict
H2 provides several deployment modes and SQL compatibility features in a free package. Its warning about untrusted connections makes deployment context a key consideration.
Plans and prices
From H2 Database Engine's own pricing page, checked 2 Oct 2026.
| Plan | Price | What it gives you |
|---|---|---|
| H2 Database Engine | Free | Free to use for everybody · source code included |
The facts
Each one read from H2 Database Engine's own pages, with the date it was checked.
What it does
- Compatibility
- Compatibility modes are listed for IBM DB2, Apache Derby, HSQLDB, MS SQL Server, MySQL, Oracle, and PostgreSQL.checked 2 Oct 2026
- Database modes
- It supports embedded, server, and mixed modes, with disk based or in memory databases.checked 2 Oct 2026
- Downloads
- The home page lists a Windows installer and an all platforms ZIP download.checked 2 Oct 2026
- Encryption
- The feature list says database files can be encrypted with AES-128 and remote JDBC connections can use TLS.checked 2 Oct 2026
- Footprint
- The home page describes a small footprint of around 2.5 MB for the JAR file.checked 2 Oct 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.checked 2 Oct 2026
- Purpose
- H2 is a free SQL database written in Java.checked 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.checked 2 Oct 2026
- SQL and APIs
- H2 supports standard SQL and JDBC, and server mode supports JDBC or ODBC over TCP/IP.checked 2 Oct 2026
- Support
- The home page directs users to Stack Overflow and a Google Group for support.checked 2 Oct 2026
- Transactions
- The feature list includes transaction support, multi version concurrency, and row level locking.checked 2 Oct 2026
- Web console
- H2 includes a browser based Console application with autocomplete.checked 2 Oct 2026
The company
- Founded
- 2004checked 23 Sep 2026
Money
- Free plan
- Yeschecked 22 Sep 2026
The full review of H2 Database Engine
Overview
H2 Database Engine is a compact, Java-based SQL database that can run inside an application or as a separate service. It suits developers who want one free engine for embedded and server deployments; its flexibility is a strength, but it is not the right choice for a server exposed to untrusted connections.
Key features
H2 can run in embedded, server, or mixed mode, with databases held in memory or stored on disk. That gives developers room to match deployment to an application’s needs without changing database engines. The small JAR footprint, around 2.5 MB, is especially useful where a lightweight embedded database matters.
Standard SQL and JDBC support make H2 a natural fit for Java applications. In server mode it accepts JDBC or ODBC connections over TCP/IP, while the browser-based Console offers autocomplete for working with databases. Transactions, multi-version concurrency, and row-level locking provide core tools for coordinating database access; compatibility modes for IBM DB2, Apache Derby, HSQLDB, Microsoft SQL Server, MySQL, Oracle, and PostgreSQL can help with applications targeting familiar SQL dialects, though they do not make H2 identical to those systems.
Database files can be encrypted with AES-128, and remote JDBC connections can use TLS. Those protections do not change the project’s central deployment caveat: H2 advises against exposing its server to untrusted connections and says it is not designed for adversarial environments. It is a better fit for controlled development, embedded use, or trusted networks than for a publicly reachable database service.
Pricing
H2 Database Engine costs nothing and is free to use for everybody, with source code included. There is no paid plan or free-trial period to weigh against a capped tier. Its dual MPL 2.0 or EPL 1.0 licensing allows integration into and distribution with commercial applications, making it practical for both personal projects and commercial software.
Platforms
H2 is listed for API, Linux, macOS, self-hosted, web, and Windows use. Downloads include a Windows installer and an all-platforms ZIP package. The project points users to Stack Overflow and a Google Group for support, so help is community-oriented rather than a paid support commitment.
Who it's for
H2 is a strong choice for Java developers who need a small SQL engine for embedded applications, local work, or a database service on a trusted network. Its multiple operating modes and free commercial-use licensing make it adaptable without a licensing bill. Teams that need a database server safe for untrusted access should look elsewhere.
Pros and cons
- Pro: Embedded, server, and mixed modes cover both in-process use and separate database deployments.
- Pro: The roughly 2.5 MB JAR and free commercial distribution make it attractive for lightweight software.
- Pro: SQL/JDBC support, server-mode ODBC, transactions, and row-level locking cover common database needs.
- Con: The project warns against untrusted connections, sharply limiting safe server exposure.
- Con: Community support through Stack Overflow and a Google Group may not suit teams that require a formal support commitment.
Alternatives
SQLite is another free embedded SQL engine and is worth considering when broad device coverage, including Android and iOS, matters more than H2’s Java-centered deployment options. Firebird is also free, with an optional Enterprise subscription priced at 199.00; consider it if you want to compare another self-hosted database option. ObjectBox offers a free core database and a free trial, making it an alternative to evaluate if a freemium product is acceptable. RxDB has a free core plan with replication and realtime sync, and may suit projects prioritizing those capabilities. libSQL is another free, self-hosted database option. LiteDB is free, including for commercial use. bbolt is a free open-source Go library and command-line utility. RocksDB is a free open-source C++ library.
Browse Embedded Databases, Relational Databases, or Database Software for more options.
Verdict
Choose H2 if you need a free, lightweight SQL database that can move between embedded and trusted server use, especially in Java software. Its small footprint, familiar interfaces, and commercial-friendly licensing are compelling; its warning about untrusted connections is the main reason to choose another engine for an exposed service.
Alternatives to H2 Database Engine
- 1

SQLite
Free planOpen sourceAndroidiOSWebAPI8.6Free plan - 2

HSQLDB
Free planOpen sourceAPILinuxmacOSSelf-hosted8.1From $100 a year - 3

MySQL
Free planAPILinuxmacOSSelf-hosted7.9Free plan - 4

Aiven for PostgreSQL
Free planOpen sourceWebAPISelf-hosted7.8From $5 a month - 5

Azure SQL Database
Free planAndroidiOSWebAPI7.7Free plan - 6

IBM Db2
Free planWebAPILinuxSelf-hosted7.4From $630 a month
