Convert numbers between hexadecimal (base 16), decimal (base 10), binary (base 2), and octal (base 8). Enter a decimal value to see its representation in all four number bases instantly.
Hexadecimal is the shorthand of computer science. Base-16 packs four binary bits into a single character, so a byte (8 bits) is just two hex digits — 00 to FF, covering 0 to 255 in decimal. That compactness is why hex appears everywhere binary data needs to be readable: HTML color codes (#FF5733), MAC addresses (00:1A:2B:3C:4D:5E), memory addresses (0x7FFE0000), Unicode codepoints (U+1F600), Git commit SHAs (a3f9c2b…), and cryptographic hashes (SHA-256 outputs).
The system uses digits 0–9 plus letters A–F for the values 10–15. Counting in hex goes 0, 1, 2, …, 9, A, B, C, D, E, F, 10 (which is 16 decimal), 11 (17), …, 1F (31), 20 (32), and so on. Each position is a power of 16: the rightmost is 16⁰ = 1, then 16¹ = 16, 16² = 256, 16³ = 4096. Once you internalize that pattern, converting between hex and decimal becomes mechanical, and reading hex dumps stops feeling alien.
This calculator converts between hexadecimal, decimal, binary, and octal in real time. Enter any decimal value and instantly see it in all four bases. Use it for debugging, color picking, file forensics, or whenever you need to translate between how humans count and how machines store.
**Scenario:** You need to know the exact RGB values behind the brand color #2E86AB. **Calculation:** Split into pairs: 2E (R), 86 (G), AB (B). Convert each: 2E = 2×16 + 14 = 46. 86 = 8×16 + 6 = 134. AB = 10×16 + 11 = 171. So #2E86AB = rgb(46, 134, 171) — a muted teal blue. **Result:** Color #2E86AB is rgb(46, 134, 171). Knowing both forms is useful: hex is compact for CSS, RGB is needed for color math, opacity blending, and most design tool APIs.
**Scenario:** A crash log shows your program faulted at 0x7FFE000A3C40 when trying to dereference a pointer. **Calculation:** This is a 48-bit address (12 hex digits). The 0x7FFE prefix indicates user-space memory on x86-64 Windows. Each hex digit = 4 bits, so 12 digits = 48 bits = the canonical x86-64 user-mode address space. **Result:** Address 0x7FFE000A3C40 = 140,732,920,201,792 decimal. Knowing the prefix patterns (0x7FFE_xxxx user-mode, 0xFFFF_xxxx kernel) helps diagnose crashes before opening a disassembler.
**Scenario:** You're writing a script and need to set file permissions to 0o755 (octal). What's the underlying bit pattern? **Calculation:** Each octal digit = 3 bits. 7 = 111, 5 = 101, 5 = 101 → 111 101 101 binary = 0x1ED hex = 493 decimal. The bits represent rwxr-xr-x: owner read/write/execute, group read/execute, others read/execute. **Result:** chmod 755 = 0o755 octal = 0x1ED hex = 493 decimal. Octal is the traditional notation because each octal digit cleanly maps to one rwx triple — historical Unix used octal for this reason.
**Hexadecimal shows up whenever you work close to the machine:**
- **Web development:** CSS colors (#RRGGBB or #RRGGBBAA for alpha), Unicode escapes (\u00E9 for "é"), URL encoding (%20 for space). - **Networking:** MAC addresses (six hex pairs), IPv6 addresses (eight 16-bit hex groups), DNS query IDs, TLS cipher suite identifiers. - **Cryptography:** SHA-256 hashes (64 hex chars), AES keys, certificate fingerprints, Bitcoin addresses (Base58 but derived from hex). - **Debugging and forensics:** memory addresses (0x… pointers), hex dumps of files (`xxd`, `hexdump`), assembly opcodes, register values in CPU traces. - **Game development and graphics:** color literals, GPU shader constants, texture format flags, vertex buffer offsets. - **Embedded systems:** I²C/SPI register maps, microcontroller datasheets, firmware addresses, OTP fuses. - **Version control:** Git commit SHAs (40 hex chars, or 7-char short form), object IDs in databases like MongoDB's ObjectId.
**Pattern recognition that helps:** - 0xFF, 0xFFFF, 0xFFFFFFFF = maximum unsigned values at 8, 16, 32 bits. - 0x80, 0x8000, 0x80000000 = the sign bit boundary for signed integers. - 0xDEADBEEF, 0xCAFEBABE, 0xFEEDFACE, 0xC0FFEE = sentinel "magic numbers" used in debugging, class file headers (Java .class starts with 0xCAFEBABE), and uninitialized memory markers. - 0x1F, 0x7F, 0xFF correspond to ASCII control character ranges and the printable boundary.
Convert binary numbers to decimal and decimal to binary.
Convert between cups, fluid ounces, milliliters, and liters.
Convert between Fahrenheit, Celsius, and Kelvin.
Convert between inches, feet, yards, miles, millimeters, centimeters, meters, and kilometers.
Convert between ounces, pounds, grams, kilograms, stone, and tons.
Convert between mph, km/h, m/s, and knots.
Decimal
255
Hexadecimal
0xFF
Binary
1111 1111
Octal
0o377