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
- Drag a .class file onto the box, or click browse to pick one.
- Read the Java version, JDK name and class file version that appear instantly.
- 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
File Type Identifier
Find out what a file really is from its magic bytes, not its extension. Detects images, audio, video, archives, fonts, and more in your browser. Private.
Hex Viewer
View any file as a classic hex dump in your browser: byte offsets, two-digit hex, and an ASCII gutter side by side. Nothing is uploaded. Copy the dump.
Strings Extractor
Extract readable text from any binary file in your browser, like the Unix strings command. See each printable run with its byte offset, set a minimum length.
Base64 File Encoder
Encode any file to Base64 and a data URI in your browser. Drop a file to get the raw Base64 and a ready data: URI to copy. Nothing is uploaded.
CBOR Decoder
Decode a CBOR file (RFC 8949) to readable JSON in your browser. Handles integers, byte strings, arrays, maps, tags, and floats. Nothing is uploaded.
CSV File Inspector
Inspect a CSV file in your browser: detect the delimiter, encoding and BOM, count rows and columns, guess the header, and preview sample rows. Private.