Decimal to Hexadecimal Converter

Convert decimal (base 10) numbers to hexadecimal (base 16) instantly, with step-by-step working, any length of number, and the result in binary, octal, decimal and hex at once.

How to convert decimal to hexadecimal

Divide by 16 repeatedly and write the remainders as hex digits (10–15 become A–F), reading from the last remainder to the first. 255 ÷ 16 = 15 r 15, so 255 = FF₁₆.

Related number conversions

How number bases work

A number base (radix) is how many different digits a system uses. In everyday decimal (base 10) each position is worth ten times the one to its right. Computers use binary (base 2, digits 0 and 1). Programmers also use hexadecimal (base 16, digits 0–9 and A–F) and octal (base 8) as compact ways to write binary: one hex digit is exactly 4 bits and one octal digit is 3 bits.

Converting to decimal

Multiply each digit by the base raised to its position (counting from 0 on the right) and add them up:

1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11₁₀

Converting from decimal

Divide repeatedly by the new base and write the remainders from last to first. 11 ÷ 2 = 5 r 1, 5 ÷ 2 = 2 r 1, 2 ÷ 2 = 1 r 0, 1 ÷ 2 = 0 r 1, which reads as 1011.

DecimalBinaryOctalHex
0000000
1000111
2001022
4010044
7011177
81000108
10101012A
15111117F
161 00002010
100110 010014464
2551111 1111377FF
1024100 0000 00002000400

Roman numerals

Roman numerals use I = 1, V = 5, X = 10, L = 50, C = 100, D = 500 and M = 1000. A smaller numeral before a larger one is subtracted (IV = 4, IX = 9, XL = 40, XC = 90, CD = 400, CM = 900). Standard numerals run from 1 to 3,999. For example, 2026 = MMXXVI.

Frequently asked questions

How do I convert binary to decimal?

Write the place values 1, 2, 4, 8, 16… from right to left under the bits and add the place values where the bit is 1. For example, 1101 = 8 + 4 + 1 = 13.

How do I convert hexadecimal to binary?

Replace each hex digit with its 4-bit binary group: 3F = 0011 1111. To go back, group the bits in fours from the right.

Can this converter handle very large numbers?

Yes. Whole numbers of any length are converted exactly using arbitrary-precision arithmetic, so 64-bit values and larger are not rounded.

Does it support negative numbers?

Yes, a leading minus sign is kept, for example −1010₂ = −10. For two's complement (signed binary) values, see the 8, 16, 32 and 64-bit rows shown for negative decimals.