---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 21 Edition"
java_version: 21
chapter: "Chapter 2. The Structure of the Java Virtual Machine"
section: "2.1"
heading: "2.1. The class File Format"
parent: "Chapter 2. The Structure of the Java Virtual Machine"
source: https://docs.oracle.com/javase/specs/jvms/se21/html/jvms-2.html#jvms-2.1
id: "2.1"
url: https://jvm.obfuscated.software/jvms/se21/2.1.html
raw: https://jvm.obfuscated.software/jvms/se21/2.1.md
---

# 2.1. The `class` File Format

Compiled code to be executed by the Java Virtual Machine is represented using a hardware- and operating system-independent binary format, typically (but not necessarily) stored in a file, known as the `class` file format. The `class` file format precisely defines the representation of a class or interface, including details such as byte ordering that might be taken for granted in a platform-specific object file format.

Chapter 4, "The `class` File Format", covers the `class` file format in detail.
