Base 10 → Base 16 • Exact BigInt

Decimal to Hex Converter

Convert base-10 decimal integers (including negative numbers and huge 64/128/256-bit integers) to hexadecimal with a complete repeated-division-by-16 breakdown.

Samples:
Hexadecimal Result (Base 16)
FF
Decimal 255₁₀ = FF₁₆
Hexadecimal
FF
Binary (Base 2)
11111111
Octal (Base 8)
377
Bit / Byte Size
8 bits (1 B)

Repeated Division by 16 (Read Remainders Bottom to Top)

StepDivisionQuotientRemainderHex Digit

How Repeated Division Converts Decimal to Hexadecimal

To convert a base-10 integer into base 16, repeatedly divide the integer quotient by 16 and record each remainder (0 through 15). Stop when the quotient reaches 0, map remainders 10–15 to letters A–F, and read the digits from bottom to top.

Worked Example: Convert 255₁₀ to Hexadecimal

  1. 255 ÷ 16 = 15 with remainder 15 (F) — least significant digit.
  2. 15 ÷ 16 = 0 with remainder 15 (F) — most significant digit.
  3. Read from bottom to top: FF₁₆.

Common Decimal to Hex Values

DecimalHexadecimalBinarySignificance
10A1010First hex letter
161010000Base 16 radix
255FF11111111Max unsigned 8-bit byte
25610010000000016² (2⁸)
4096100010000000000004 KiB memory page size
65535FFFF1111111111111111Max unsigned 16-bit integer / TCP port

Common Mistakes & Use Cases

  • Reading remainders top-to-bottom: The first remainder is always the rightmost (least-significant) hex digit.
  • Confusing negative sign-magnitude with two's complement: Entering -255 here outputs -FF. If you need an 8/16/32-bit two's complement register encoding (like -1 → FF), use the Two's Complement Calculator.
  • Typical applications: Generating CSS RGB hex colors, formatting hardware register masks, converting Unix timestamps or IDs to compact hex strings.

Frequently Asked Questions

How do I convert decimal 255 to hex?

Divide 255 by 16 to get quotient 15 remainder 15 (F), then divide 15 by 16 to get quotient 0 remainder 15 (F). Reading bottom to top yields FF.

Does uppercase vs lowercase hex change the numeric value?

No. 0xFF and 0xff represent the exact same number (255). Use the lowercase toggle if your codebase style guide prefers lowercase hex literals.

Can I convert decimal numbers larger than 9 quadrillion?

Yes. Because this tool uses native JavaScript BigInt arithmetic, integers of hundreds of digits convert cleanly without rounding.