Skip to main content
Calcimator

Hex Converter

Convert between hexadecimal, decimal, binary, and octal number systems. Essential for programming and computer science.

About this calculator

Computers store every value in binary (base 2), but raw binary strings get long and hard to read quickly, so programmers commonly use hexadecimal (base 16) as a compact stand-in -- each hex digit represents exactly four binary digits, so a byte (8 bits) always fits in exactly two hex characters. This calculator takes a decimal number and shows its equivalent in hexadecimal (both with and without the common 0x prefix used in most programming languages), binary (both raw and zero-padded to 8 bits), and octal (base 8), which remains common in Unix file permission notation like chmod 755. The conversion itself is a pure base-change operation: the same underlying integer value is being re-expressed in a different radix, not altered in any way, so 255 in decimal, FF in hex, 11111111 in binary, and 377 in octal all represent the identical quantity.

Hexadecimal shows up constantly in practice -- CSS and design tool color codes, memory addresses in debuggers, MAC addresses, and hash digests are all typically displayed in hex because it packs binary information into a shorter, more scannable string than decimal or binary would. Understanding that these are different NOTATIONS for the same number, not different quantities, is the core idea behind every conversion this tool performs.

Convert

Results

Hexadecimal
FF
Hex (0x)
0xFF
Binary
11111111
Binary (8-bit)
11111111
Octal
377
How to Use This Calculator
  1. Enter the Decimal value you want to convert (e.g., 255 equals 0xFF in hex).
  2. Read the Hexadecimal output with and without the 0x prefix — copy directly into code.
  3. Check the Binary output for bit-level inspection of the same value.
  4. Use the 8-bit padded Binary form when working with byte-aligned data structures.
  5. The Octal result is useful for Unix file permission modes and legacy system work.

Recommended for this calculation

We may earn a commission if you sign up through these links.

Anker

Never run out of battery mid-project again

Anker PowerCore 10000 Portable Charger

See on Amazon
TP-Link

Fast, reliable WiFi 6 for every device in the house

TP-Link Archer AX21 AX1800 WiFi 6 Router

See on Amazon
Raspberry Pi

A full computer small enough for any project

Raspberry Pi 5, 8GB RAM

See on Amazon

Anker: As an Amazon Associate I earn from qualifying purchases.

TP-Link: As an Amazon Associate I earn from qualifying purchases.

Raspberry Pi: As an Amazon Associate I earn from qualifying purchases.

What each input means

Decimal
Enter a decimal number

How this is calculated

Formula

Hex = Decimal converted to base 16

Worked example, using the default values

  1. Identify Input Parameters
    Decimal = 255 = 1 input(s) provided
  2. Calculate Hexadecimal
    Hexadecimal
    FF = FF
  3. Calculate Hex
    Hex
    0xFF = 0xFF
  4. Calculate Binary
    Binary
    11111111 = 11111111

Engine last updated . Checked against 2 independently-derived tests how we verify calculators.

Frequently Asked Questions

Why do programmers use hexadecimal instead of just decimal or binary?

Hexadecimal strikes a practical balance: each hex digit maps cleanly onto exactly four binary digits, so converting between binary and hex is mechanical and error-free by hand, while hex strings stay far shorter and more readable than the equivalent binary string. That's why memory addresses, color codes, and hashes are conventionally shown in hex rather than binary.

What does the 0x prefix in front of a hex number mean?

It's a notational convention, used in most programming languages, that marks the number following it as hexadecimal rather than decimal -- without it, a value like FF could be ambiguous or simply wouldn't parse as a number at all in code. The prefix itself isn't part of the numeric value; 0xFF and FF represent the same quantity.

How many bits does one hexadecimal digit represent?

Exactly four bits, since 16 (the base of hex) is 2 to the fourth power. That clean relationship is why a full byte (8 bits) always converts to exactly two hex digits, which is part of why hexadecimal became the standard shorthand for binary data in low-level programming.

Is octal still used for anything today?

Its most common surviving use is Unix and Linux file permission notation, where a mode like 755 encodes read/write/execute permissions for owner, group, and others as three octal digits. Outside of that context, hexadecimal has largely replaced octal as the preferred compact representation for binary data.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Technology & Computing.