Beginner

Decimal to Hexadecimal Converter

Enter a whole decimal number and see the hexadecimal equivalent instantly — plus binary, octal and byte size for context.
Non-negative whole number (integer)
Hexadecimal result
0xFF
Hexadecimal
0xFF
Binary
1111 1111
Octal
0o377
Hex nibbles
2
Bytes required
1
0326496128160192224256Position on the number line (up to 0xFFFF)
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

Divide the decimal by 16 repeatedly, collecting remainders (10→A … 15→F) in reverse order. Example: 255 ÷ 16 = 15 r 15, 15 ÷ 16 = 0 r 15 → remainders reversed: FF → 0xFF. Or convert to binary first, then group into nibbles and replace each with its hex digit. Uses BigInt for arbitrary precision.

Formula
Divide by 16 repeatedly; collect remainders in reverse → hex digits (10→A, 11→B, …, 15→F)
How this is calculated

To convert a decimal integer to hexadecimal, repeatedly divide by 16 and record each remainder as a hex digit. Remainders 0–9 stay as digits; 10–15 become A–F. Collect the remainders in reverse order. For 255: 255 ÷ 16 = 15 r 15, then 15 ÷ 16 = 0 r 15. Remainders bottom-up: 15, 15 → F, F → 0xFF.

The equally fast shortcut is to convert decimal to binary first (or use binary as the intermediate), then group the binary bits into nibbles (4-bit groups) from the right and swap each nibble for the corresponding hex digit. This makes the structural relationship between hex and binary clear — one hex digit always equals exactly four binary bits.

This calculator uses JavaScript BigInt, so arbitrarily large integers (beyond the 53-bit safe integer limit of regular floating-point) are converted exactly. Binary and octal are also shown to complete the picture. The byte count shows how many 8-bit bytes are needed to store the value.

Frequently asked questions

255 in binary is 11111111. Group into two nibbles: 1111 and 1111, each equal to 15 = F. So 255 = 0xFF. Alternatively: 255 ÷ 16 = 15 remainder 15 → FF.

Hexadecimal needs 16 symbols for digits 0–15. The letters A through F represent values 10 through 15 respectively. A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.

Hex is four times more compact than binary (8 bits = two hex digits instead of eight binary digits) and maps cleanly back to bits because 2⁴ = 16. It appears in colour codes (#FF5733), memory addresses (0x7FFF), machine code, cryptographic hashes and network addresses.

Also known as

decimal to hex converter
base 10 to base 16 converter
integer to hexadecimal
convert number to hex
decimal hex calculator
hex code from decimal
number to hex digits

APA

TG we-Calculate Editorial Team. (2026). Decimal to Hexadecimal Converter [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/decimal-to-hexadecimal-calculator

Chicago

TG we-Calculate Editorial Team. "Decimal to Hexadecimal Converter." TG we-Calculate. 2026. https://we-calculate.com/calculator/decimal-to-hexadecimal-calculator.

IEEE

TG we-Calculate Editorial Team, "Decimal to Hexadecimal Converter," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/decimal-to-hexadecimal-calculator

BibTeX

@misc{wecalculate_decimal_to_hexadecimal_calculator, title = {Decimal to Hexadecimal Converter}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/decimal-to-hexadecimal-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?