yGuard - Java™ Bytecode Obfuscator and Shrinker

yGuard is a free Java bytecode obfuscator and shrinker that improves your software deployment by prohibiting unwanted access to your source code and drastically shrinking the processed Jar files at the same time.

The current yGuard version is 2.7.1.

Please refer to the requirements and changelog for details about the latest version.

Open Source

  • yGuard is now fully open source! Obfuscate your code in just minutes in Ant, Maven and Gradle.
  • You can find the tool with the source code on GitHub.


yFiles for JavayEd Editor
  • yGuard is absolutely free! Contrary to expensive commercial products of our competitors providing the same amount of features as yGuard or less, yGuard is free.
  • yGuard is an Ant task! Existing tools use proprietary mechanisms to invoke or configure the task of obfuscation. As an Ant task, yGuard can be seamlessly integrated into your deployment process using XML syntax.
  • yGuard provides highly configurable name obfuscation that will protect your intellectual property from reverse engineering.
  • yGuard provides elaborate code shrinking functionality through dependency analysis.
  • yGuard 2.0 offers a new 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.
  • yGuard supports JDK 1.5 features and correctly obfuscates classes compiled with its new features.

Why Use yGuard?

  • Name Obfuscation: 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.
    As an additional side-effect, name obfuscation will significantly reduce the size of your application, depending on the chosen mapping scheme.
  • Code Shrinking: drastically reduces the size of the input Jar files if your application does not use all of the contained bytecode.
    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.


The yGuard Manual is a detailed user guide which will enable you to use yGuard as an ordinary Ant task. The Change Log describes bugfixes and improvements added to new yGuard releases.


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).

Java Compatibility

Java 11 Compatibility

Beginning with version 2.7, yGuard supports obfuscation of Java class files that contain nesthost or nestmembers attributes which were introduced with the Java 11 .class file format.

yGuard does not support obfuscating dynamic instructions which were introduced with the Java 11 .class file format.

Java 9 / Java 10 Compatibility

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 / Java 8 Compatibility

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.

Contact yWorks

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

Thank you!
Your message has been sent to contact@yworks.com
We are sorry,
Your request could not be sent to contact@yworks.com. Please reload the page and try again.
If the problem persists, please report the error to contact@yworks.com