Boneyard Tools

Java Class File Version Viewer

Drop in a compiled Java .class file to see which Java release built it. The tool validates the 0xCAFEBABE magic number, reads the major and minor version words, maps the major version to its Java release (for example major 52 means Java 8, major 61 means Java 17), and reports the constant pool count. Everything is read in your browser and never uploaded.

How to check a Java class file version

  1. Drag a .class file onto the box, or click browse to pick one.
  2. Read the Java version, JDK name and class file version that appear instantly.
  3. Check the preview badge to see if the class was built with preview features.

Examples

A class compiled with JDK 8

Main.class (built by javac from a JDK 8)
Java 8, Java SE 8, class file version 52.0

Frequently asked questions

Is my class file uploaded anywhere?

No. The .class file is read and parsed entirely in your browser using JavaScript. Nothing is sent to a server, so proprietary or internal bytecode stays on your device.

How does it work?

Every Java class file starts with the four magic bytes 0xCAFEBABE, followed by a 2-byte minor version and a 2-byte major version. The tool reads those big-endian values and maps the major version to the Java release: 52 is Java 8, 61 is Java 17, and so on.

What is the difference between the class file version and the Java version?

The class file version (like 52.0) is the bytecode format version stored in the file. The Java version (like 8) is the matching language release. The major number maps directly to a release; the minor number is usually 0.

What does the preview badge mean?

When a class is compiled with preview language features, the JVM sets the minor version to 0xFFFF (65535). The tool flags that as a preview build, which means it can only run on the exact JDK that produced it.

Why is the constant pool count one more than the real number of entries?

The JVM specification defines constant_pool_count as the number of entries plus one, so the highest valid index is the count minus one. The tool reports the raw value from the file and notes this.

Related tools