CLASS JAVA
File conversion

Convert CLASS to JAVA

QUICK ANSWER
Is it possible to convert CLASS to JAVA?
Yes - CLASS converts to JAVA.

Drag the .class file onto JD-GUI to view and save reconstructed Java source, or run java -jar cfr.jar MyClass.class --outputdir ./out. The output is approximate - comments cannot be recovered and local variable names are usually replaced with generated ones unless the class was compiled with debug info.

Also to JAVA: JWS · SMALI · VDM

On this page

Tested on macOS, Windows & Linux
Last verified Oct 2026

More free converters

HEIC, PNG, WEBP, MP3 and more - every tool here is free.

Open the toolbox

Why convert CLASS to JAVA?

A .class file stores compiled bytecode, not source code. Decompiling is useful when the original .java files are lost or unavailable, for auditing third-party code, or for understanding what a compiled class does. A decompiler reverse-engineers an approximation of the original Java source.

How to convert CLASS to JAVA

JD-GUI OPEN-SOURCE

Drag the .class file onto the JD-GUI window and the reconstructed source appears immediately. Use File > Save All Sources to export .java files.

CFR OPEN-SOURCE

Run java -jar cfr.jar MyClass.class --outputdir ./out and the decompiled .java file appears in the output folder.

IntelliJ IDEA Community FREE

Open or drag the .class file into the editor; IntelliJ automatically decompiles it using the built-in Fernflower engine and displays the source.

About these formats

Quality & what to watch

  • Comments in the original source are stripped by the compiler and cannot be recovered from bytecode.
  • Original local variable names are usually replaced with generated names such as var1, var2 unless the class was compiled with debug info (javac -g).
  • Obfuscated classes (processed with ProGuard or R8) decompile into barely readable code - the decompiler works, but output reflects obfuscated names.

Frequently asked questions

Is decompiled Java source recompilable?
Usually yes for simple classes, but complex lambda expressions or heavily inlined code may need manual fixes before it compiles cleanly.
How do I know which Java version compiled the class?
The major version in the .class header indicates the Java release - for example, 52 = Java 8, 61 = Java 17, 65 = Java 21.
What if I only need to inspect the bytecode, not recover Java source?
javap -c -p MyClass (bundled with the JDK) disassembles the bytecode to mnemonics without a separate download.