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
How to Use This Calculator
- Enter the Decimal value you want to convert (e.g., 255 equals 0xFF in hex).
- Read the Hexadecimal output with and without the 0x prefix — copy directly into code.
- Check the Binary output for bit-level inspection of the same value.
- Use the 8-bit padded Binary form when working with byte-aligned data structures.
- 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.
Fast, reliable WiFi 6 for every device in the house
TP-Link Archer AX21 AX1800 WiFi 6 Router
See on AmazonAnker: 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 16Worked example, using the default values
- Identify Input ParametersDecimal = 255 = 1 input(s) provided
- Calculate HexadecimalHexadecimalFF = FF
- Calculate HexHex0xFF = 0xFF
- Calculate BinaryBinary11111111 = 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.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Binary/Hex/Decimal Converter
Convert a decimal number into its binary, octal, and hexadecimal representations. Includes bit count, byte size, and ASCII character lookup.
Technology & ComputingDecimal Converter
Convert decimal numbers to binary, hexadecimal, and octal. Essential tool for programming and computer science.
Technology & ComputingNumber Converter Suite
Convert binary, hex, decimal, colors, ASCII, and signed integers.
Number TheoryNumber Base Converter
Convert numbers between any base (2-36). Enter a number in one base and convert to another.
More in Technology & Computing.