Free Java™ Bytecode
Obfuscator and Shrinker

A monitor displaying partial obfuscated and un-obfuscated code

Secure and compact code

For Everyone
For Techies

yGuard is a free and open source Java bytecode obfuscator and shrinker. By obfuscation you can convert your compiled code into one that is difficult to understand for humans. This way you can secure it from unwanted access.
At the same time it shrinks the code size drastically, which helps to reduce the startup time of the application.

yGuard is a free and open source Java bytecode obfuscator and shrinker. It can process .class files compiled by any stable JDK (up to Java 14). yGuard provides functionality to rename classes, interfaces, methods etc. in order to scramble the resulting archive, making it much harder to reverse-engineer.
Additionally yGuard offers code-shrinking functionality which reduces archive size (faster startup) by removing dead code.
What's New?

Check out the changelog.

Free Download

Fully Open Source

Because we want to give something back to the community!
Open Source is an essential part of modern software development and helps us to create better software every day. We want to be part of that movement! Thats why we made yGuard fully open source.

Why use yGuard?

Name Obfuscation

yGuard protects your .class files from reverse engineering by replacing package, class, method, and field names with inexpressive characters. If afterwards the obfuscated .class files are decompiled, it will be extremely difficult to derive the original purpose of the obfuscated code entities.

Code Shrinking

yGuard drastically reduces the size of the input Jar files if your application does not use all of the contained bytecode. This reduces the startup time of your application.

The shrinking engine analyzes the bytecode of all input Jar files in order to determine which code entities can not be reached from a set of given code entry points. These obsolete code fragments (either entire classes or single methods and fields) will then be removed by yGuard. If you use any third party libraries, you will probably benefit a lot from the yGuard shrinking engine, since applications usually do not use all of the functionality provided by an external library and a large fraction of the contained bytecode and resources can be safely removed.

yGuard features

Easy setup

yGuard is an Ant task! As an Ant task, yGuard can be seamlessly integrated into your deployment process in a multitude of build systems such as Ant, Maven and Gradle

Advanced shrinking

yGuard provides elaborate code shrinking functionality through dependency analysis.

Configureable / secure code

yGuard provides highly configurable name obfuscation that will protect your intellectual property from reverse engineering.

Open Source

yGuard is fully open source! Contrary to expensive commercial products yGuard is and always will be free.

yGuard offers a powerful and easy to use XML syntax that allows the effortless definition of code entities e.g. based on pattern sets or inheritance.
yGuard will correctly obfuscate and shrink programs that depend on external libraries.
yGuard can automatically rename and adjust textual resource files according to the obfuscation scheme.
yGuard can scramble and unscramble or shrink line number table information. This means that debugging an obfuscated program is still achievable without weakening the obfuscation.
yGuard can create patches! During each obfuscation run, yGuard produces XML output that can be used to create subsequent patches of already deployed obfuscated applications.
more features

Free license

Free & Open Source

Because we want to give something back to the community!
Open Source is an essential part of modern software development and helps us to create better software every day. We want to be part of that movement! Thats why we made yGuard fully open source.

You can find the source code on Github.

Technical information

Requirements

To run the yGuard software, you need JDK 1.7.x or greater and Ant 1.5.x or greater (it might be compatible with earlier versions of either software, this has not been tested, however).

Support

Find helpful links for questions and supporting information:

Java compatibility

Java
11-13

Beginning with version 2.10, yGuard supports obfuscation of Java class files that contain nesthost or nestmembers attributes which were introduced with the Java 11 .class file format. Further yGuard does support obfuscating dynamic instructions which were introduced with the Java 11 .class file format.

Please read the notes regarding 3rd party JVM support if you intend to use yGuard with something other than Java.

Java
9-10

Beginning with version 2.7, yGuard supports obfuscation of Java class files that contain module information which was introduced with the Java 9 .class file format. yGuard does not change module names, though.

yGuard does not support obfuscating multi-release Java archives which were introduced with Java 9.

Java
7-8

Beginning with version 2.5, yGuard supports obfuscation of Java class files that contain the invokedynamic instruction, which was introduced with the Java 7 .class file format. JDK 7 does not contain any means of issuing this instruction, with JDK 8 it is being issued when using lambda expressions or default methods.

While yGuard does fully support obfuscating invokedynamic instructions and therefore default methods and lambda expressions, shrinking of Java class files that contain the invokedynamic instruction is not supported yet.

Java
6

yGuard fully supports obfuscation of Java 6 (and earlier/older) class files.

Free Download

Getting started

Step 1
Download

yGuard is available for any of the major build tools in the Java ecosystem. The software is provided as on Maven Central. Additionally the archives are also available on GitHub.

Step 2
Configuration

Before using yGuard you will need to set it up for your favorite build tool, but no problem there. yGuard comes with exhaustive documentation including all the necessary steps to get you started. If you seek to solve a complex problem, we provide additional examples.

Step 3
Security

Once you have downloaded and configured yGuard, you can enjoy the additional security provided to your product. Free of charge, because yGuard is open-source!

Free Download

Why, how, what? —
Just ask the diagramming experts!

Our team is happy to advise you – no strings attached. Let's talk about your project and find the perfect solution for your needs!

E-mail: hello@yworks.com

The data you enter will only be used to contact you.
Learn about our privacy policy.