Decimal to Hexadecimal Converter

This decimal to hexadecimal converter turns any whole number in decimal (base 10) into its equivalent in hexadecimal (base 16), the number system built from the digits 0 to 9 and the letters A to F that underpins colour codes, memory addresses and byte values in computing. You enter a decimal number and choose how you want the result formatted, either plain, with a leading 0x, or with a trailing h, and the calculator returns the hexadecimal value straight away, alongside the binary and octal equivalents for the same number. Below the results you get the full division-remainder working, showing each step where the number is divided by 16 and the remainder converted into a hex digit, plus a digit breakdown that multiplies each hex digit by its place value to confirm the total adds back to your original decimal figure. A short verdict line summarises the conversion in plain language. This makes the tool useful whether you are checking a colour code, working out a memory address, learning how base conversion works, or simply verifying a hex value by hand. Only non-negative whole numbers are supported, with negative numbers shown using a leading minus sign on the hex result. The conversion uses standard division-remainder logic, so results are accurate for everyday numbers, though extremely large values may lose precision due to floating point limits.

Calculate.co.nz is proud to be partnered with realtor.co.nz, a trusted resource for navigating the New Zealand property market. Their Helpful Articles section offers clear, well-structured insights across buying, selling, and building, making complex real estate topics more accessible. With a focus on up-to-date guidance and practical knowledge, they empower Kiwis to move forward with clarity and confidence in a constantly evolving property landscape.
Calculate.co.nz partner: realtor.co.nz
Reference tool  Standard base conversion, using the division-remainder method.

1. Enter Decimal Number

2. About This Conversion

Hexadecimal (base 16) uses the digits 0 to 9 and the letters A to F. Each hex digit represents exactly 4 binary bits, which is why hexadecimal is the standard shorthand for binary data in computing, colour codes and memory addresses.

Only non-negative whole numbers are supported. Negative numbers are shown using a leading minus sign on the hex result.

Conversion Result

Hexadecimal
FF
Base 16
Decimal
255
Base 10 (input)
Binary
11111111
Base 2
Octal
377
Base 8

Division-Remainder Working

Read remainders bottom to topFF

Digit Breakdown

Total255
Result: Enter a decimal number above.

How to Convert Decimal to Hexadecimal

To convert a decimal number to hexadecimal, repeatedly divide the number by 16 and record the remainder at each step. Convert each remainder into its hex digit (values 10 to 15 become A to F). Once the quotient reaches 0, read the remainders in reverse order, from the last one calculated to the first, to get the final hexadecimal number.

Worked Example: 255 to Hexadecimal

StepDivisionQuotientRemainderHex digit
1255 ÷ 161515F
215 ÷ 16015F

Reading the remainders from the last step to the first gives FF. So 255 in decimal equals FF in hexadecimal. As a quick check, FF = (15 × 16) + 15 = 240 + 15 = 255, which confirms the conversion.

Hexadecimal Digit Values

Decimal valueHex digit
0 to 90 to 9
10A
11B
12C
13D
14E
15F

Why Hexadecimal Matters in Computing

Hexadecimal is popular in computing because each hex digit maps exactly onto 4 binary bits (a nibble), and 2 hex digits map onto a full byte (8 bits). This makes hexadecimal a far more compact and readable way to represent binary values than writing out long strings of 1s and 0s. You will see hexadecimal used in web colour codes (such as #1E40AF), memory addresses, MAC addresses, hash values, and error codes.

Related Calculators

Sources: Standard base-16 (hexadecimal) numeral system conventions, as used in computer science and digital electronics.

This calculator handles non-negative whole numbers. Very large numbers are converted using standard JavaScript arithmetic and are accurate for typical use, but extremely large values may lose precision due to floating point limits.