Code · .class

How to open a .class file

The short version: CLASS is a Java Bytecode Class from Sun Microsystems. The longer version — including the quirk that trips most people up — is below, along with a viewer that runs entirely on your own device.

What is a .class file?

Java Bytecode Class is a code format developed by Sun Microsystems, first appearing in 1995. It is normally produced by Java compilers.

The magic number is literally the word 'cafebabe' — chosen by James Gosling's team over lunch at a café.

Full nameJava Bytecode Class
File categoryCode
MIME typeapplication/java-vm
Magic bytes (file signature)CA FE BA BE
DeveloperSun Microsystems
Introduced1995
Usually created byJava compilers
OpenAnyFile enginesyntax highlighter
Opens without uploadYes — parsed locally in your browser

Open a .class file in your browser

OpenAnyFile routes .class to its syntax highlighter, which highlights the source with language-aware colouring and line numbers.

  1. Open the OpenAnyFile opener in this browser — nothing to download or sign up for.
  2. Drag your .class file onto the drop zone, click to browse for it, or paste it with Ctrl+V.
  3. The extension is detected and the file is handed to the syntax highlighter.
  4. Your CLASS opens on its own viewer page: the source with language-aware colouring and line numbers.
  5. Use fullscreen for a closer look, or download the file back out unchanged. Free, and free in the sense that there is no paid tier waiting behind step three.

What you can and cannot do with it here

Works

Viewing, inspecting and verifying. You get the source with language-aware colouring and line numbers. File details, exact byte size and the detected signature are always shown.

Does not work

Editing and re-saving. OpenAnyFile is a reader, not an editor — for changes you still need special software or an equivalent.

Is it safe to open a {E} file on a website?

It depends entirely on whether the website uploads it, and almost all of them do. That is a real problem when the code file in question is a contract, a client deliverable or something under NDA. OpenAnyFile removes the question: the decoding happens inside your browser tab, so there is no transfer, no queue, no temporary storage and no retention window to read about in a privacy policy.

Frequently asked questions about CLASS files

Can I open a .class file without installing special software?

Yes. OpenAnyFile's syntax highlighter runs in your browser, so you can read a CLASS file with nothing installed. You get the source with language-aware colouring and line numbers. For full editing you still need the original application — this is a viewer, not an editor.

How can I check a file really is a CLASS file?

Look at the first bytes rather than the extension. A genuine CLASS begins with CA FE BA BE. Opening the file in OpenAnyFile shows that signature in the file-details panel, so a file renamed to .class by mistake is easy to spot.

Is it safe to open a CLASS file online?

With OpenAnyFile, yes, because nothing is uploaded. The file is read locally through your browser's File API and never leaves your device, so there is no server copy to leak, log or retain. That matters most for the kind of file people are least willing to hand to a random converter site.

What is a .class file, exactly?

Java Bytecode Class — an application/java-vm format created by Sun Microsystems since 1995. The magic number is literally the word 'cafebabe' — chosen by James Gosling's team over lunch at a café.

Does the same viewer handle formats related to CLASS?

Yes — the same engine also opens .html, .xml, .sql, so you can compare related files without switching tools.

Related formats

These open with the same engine, so if you have one of these sitting next to your .class file, it will open too:

⚡ Open your .class file now All 300 file types