R8
R8 is a free, open-source Java program optimizer that shrinks and minifies code while producing optimized DEX for Android.
What R8 is
R8 is a free, open-source Java program optimizer that shrinks and minifies code while producing optimized DEX for Android. The same repository includes D8, which converts Java bytecode to DEX. R8 can remove unreachable code, inline methods, merge classes, and shorten class, field, and method names to reduce DEX size. With Android Gradle Plugin 8.12.0 and later, its optimization phases can also optimize resources. R8 takes class files as input and can produce Android DEX or Java class files. Android Gradle Plugin includes R8, and that embedded version can be replaced with a prebuilt or locally built JAR. R8 can also be integrated into a Bazel build pipeline, though Bazel is not officially supported for Android app development. Configuration uses the ProGuard format, with keep rules supplied in a file using the --pg-conf option. Stable and development builds are available from Google Maven, and CI archive downloads are documented. The project recommends enabling it for a tested release build, while noting that optimization can increase build time and make debugging harder. Its command line is not compatible with ProGuard in every respect.
Good
- Removes unreachable code and can inline methods.
- Can merge classes and shorten names.
- Android Gradle Plugin ships with R8 embedded.
- Stable and development builds are available.
- Supports Android DEX and Java class-file output.
Watch out
- Optimization can increase build time.
- Optimization can make debugging harder.
- Keep rules must be supplied in a configuration file.
- Bazel is not officially supported for Android app development.
Who it suits
R8 suits developers optimizing Java programs for Android DEX output or Java class-file output. It may also fit Android build pipelines using Android Gradle Plugin, while teams considering Bazel should note that Android app development support is not official.
Verdict
R8 offers code shrinking and optimization, with Android Gradle Plugin integration and a companion D8 converter in the same repository. Account for longer builds, harder debugging, and command-line differences from ProGuard when choosing it.
Plans and prices
From R8's own pricing page, checked 11 Oct 2026.
| Plan | Price | What it gives you |
|---|---|---|
| R8 | Free | Open-source repository; prebuilt stable and development versions available |
The facts
Each one read from R8's own pages, with the date it was checked.
Where it runs
- Android integration
- The Android Gradle plugin ships with R8 embedded, and the repository documents how to override that version.checked 11 Oct 2026
- Platform requirements
- The build instructions say the first run bootstraps Gradle and required JDKs, and Android-targeted R8 use requires an Android SDK platform android.jar.checked 11 Oct 2026
What it does
- Build
- The documented source build uses Chromium depot_tools and produces a JAR containing both R8 and D8.checked 11 Oct 2026
- Build requirements
- Building from source requires depot_tools and a Java 8 compiler and runtime; the documented IntelliJ setup points to a Linux JDK path.checked 4 Oct 2026
- Compatibility limit
- R8 is not command-line compatible with ProGuard; keep rules must be passed in a configuration file using --pg-conf.checked 11 Oct 2026
- Configuration
- R8 uses the ProGuard configuration format to configure whole-program optimization and application entry points.checked 11 Oct 2026
- Contributions
- Contributors must sign a Contributor License Agreement, or a Corporate Contributor License Agreement when the contribution belongs to their employer.checked 11 Oct 2026
- D8 modes
- D8 defaults to debug mode, and its release mode removes debugging information to produce smaller DEX files.checked 11 Oct 2026
- Distribution
- Stable and development builds are available from Google Maven, and the project also documents CI archive downloads.checked 4 Oct 2026
- Downloads
- Stable and development prebuilt versions are available from Google Maven and the project's CI archive.checked 11 Oct 2026
- Input and output
- R8 consumes class files and can output DEX for Android apps or class files for Java apps.checked 11 Oct 2026
- Integration
- Android Gradle Plugin ships with R8 embedded, and users can override the embedded version with a prebuilt or locally built JAR.checked 4 Oct 2026
- Intended users
- The documentation describes R8 as an app optimizer and recommends enabling it for a tested release build, while warning that optimization can increase build time and make debugging harder.checked 4 Oct 2026
- Notable limitation
- The R8 command line is not compatible with ProGuard in every respect; for example, keep rules must be supplied in a file rather than on the command line.checked 4 Oct 2026
- Obfuscation
- R8 shortens class, field, and method names to reduce DEX file size.checked 4 Oct 2026
- Optimization
- R8 removes unreachable code and can optimize execution through method inlining and class merging.checked 4 Oct 2026
- Other build systems
- R8 can be integrated into a Bazel build pipeline, though the Android Developers page says Bazel is not officially supported for Android app development.checked 4 Oct 2026
- Product
- The repository contains D8, which converts Java bytecode to DEX, and R8, which shrinks and minifies Java programs while producing optimized DEX code.checked 11 Oct 2026
- R8 compiler
- R8 is a whole-program optimizing compiler focused on reducing program size.checked 11 Oct 2026
- Resource optimization
- R8 optimizes resources as part of its optimization phases with Android Gradle Plugin 8.12.0 and later.checked 4 Oct 2026
- Security and compliance
- The opened R8 project page contains no security or compliance claims.checked 4 Oct 2026
- Support
- The project directs users to [email protected] for questions and to separate issue trackers for D8 and R8.checked 11 Oct 2026
- What it does
- R8 is a Java program shrinking and minification tool that converts Java bytecode to optimized DEX code; the same repository includes D8, which converts Java bytecode to DEX.checked 4 Oct 2026
Alternatives to R8
- 1
Enigma Protector
WebAPILinuxSelf-hosted7.4 - 2
JS-Confuser
Free planOpen sourceWebAPILinuxmacOS7.4Free plan - 3
Jscrambler
AndroidiOSWebAPI7.0 - 4
Tigress
Free planAndroidLinuxmacOSWindows6.8Free plan - 5

ByteHide Shield
Free planAndroidiOSWebLinux6.7Free plan - 6
JavaScript Obfuscator
Free planWebAPIExtensionSelf-hosted6.7From $19 a month
