Common Hex Values, Explained
Frequently used hex constants like 0xFF, 0x7F, and 0xFFFFFFFF, explained — what each one represents and where it actually shows up in code.
Why These Specific Values Keep Coming Up
Most of the values on this page aren't arbitrary — they mark a boundary (the largest or smallest value a type can hold), a well-known byte (a control character, a file format's magic number), or a deliberately recognizable pattern (like 0xDEADBEEF). Knowing them by sight saves a trip to a calculator every time one shows up in a debugger or log.
Reference List
| Hex | Decimal | What it is |
|---|---|---|
| 0x00 | 0 | Zero, or a null byte — every bit cleared. Common as a default, uninitialized, or "empty" value. |
| 0x0A | 10 | The line feed (LF) byte — the newline character on Unix-style systems. |
| 0x0D | 13 | The carriage return (CR) byte — combined with LF (0x0D 0x0A) for Windows-style line endings. |
| 0x20 | 32 | The space character — the lowest printable ASCII code point. |
| 0x7F | 127 | The largest value a signed 8-bit integer can hold, and the ASCII DEL control character. |
| 0x80 | 128 | One more than 0x7F — the smallest (most negative) value a signed 8-bit integer can hold in two's complement, since only the sign bit is set. |
| 0xFF | 255 | The largest value an unsigned byte can hold — all 8 bits set to 1. Common as a full-byte mask and as full opacity in an 8-bit alpha channel. |
| 0x7FFF | 32,767 | The largest value a signed 16-bit integer can hold. |
| 0xFFFF | 65,535 | The largest value an unsigned 16-bit integer can hold — also the maximum value of a 16-bit port number. |
| 0x7FFFFFFF | 2,147,483,647 | The largest value a signed 32-bit integer can hold — also the last second a 32-bit signed Unix timestamp can represent before the Year 2038 problem. |
| 0xFFFFFFFF | 4,294,967,295 | The largest value an unsigned 32-bit integer can hold — all 32 bits set to 1, often used as an "all flags set" or sentinel value. |
| 0xDEADBEEF | 3,735,928,559 | A recognizable hex word deliberately used by some debuggers and memory allocators to mark uninitialized or freed memory, so it's instantly identifiable in a crash dump. |
| 0xCAFEBABE | 3,405,691,582 | The magic number at the start of every compiled Java .class file, used by the JVM to identify the file format before parsing it further. |
Where These Values Actually Come Up
Recognizing a Type's Overflow Boundary
Spotting 0x7FFFFFFF or 0xFFFFFFFF in a bug report immediately suggests a signed or unsigned 32-bit integer overflow, without needing to compute the boundary from scratch.
counter reads 0x7FFFFFFF right before a crash
Spotting a Memory Debugging Marker
Seeing 0xDEADBEEF (or similar patterns like 0xFEEEFEEE) in a crash dump is a strong signal that code read from memory that was never initialized or was already freed.
pointer value == 0xDEADBEEF
Identifying a File Format From Its Magic Number
Checking the first few bytes of an unknown file against known magic numbers (like 0xCAFEBABE for Java class files) is a fast way to identify what you're looking at.
file starts with CA FE BA BE -> .class file
Further reading: Hexadecimal — Wikipedia
Limitations
- This is a curated list of especially common values, not an exhaustive catalog — many other magic numbers and boundary constants exist beyond what's shown here.
Frequently Asked Questions
Why does 0xFF show up so often?
0xFF is 255 — the maximum value a single unsigned byte can hold, and 8 bits all set to 1. It's the standard "all bits set" mask for one byte, and shows up constantly in masking code and as full opacity (255) in an 8-bit alpha channel.
Why is 0x7F specifically significant?
0x7F (127) is the largest value a signed 8-bit integer can hold — one more (0x80) flips into negative territory in two's complement. It's also the DEL control character in ASCII.
What's special about 0xDEADBEEF?
It's not a computed value — it's a recognizable hex word (spelling "DEAD BEEF" using only valid hex digits) deliberately written into memory by some debuggers and allocators, so a crash pointing at that exact value is an instant sign of uninitialized or freed memory.
Why do 32-bit systems care about 0x7FFFFFFF?
It's the largest value a signed 32-bit integer can hold (2,147,483,647) — for Unix timestamps specifically, it also marks the Year 2038 problem, the moment a 32-bit signed timestamp overflows.
What does 0x80000000 represent?
The smallest (most negative) value a signed 32-bit integer can hold in two's complement — only the sign bit is set, and every other bit is 0.