dopecalc

Hexadecimal Calculator

Convert between decimal and hexadecimal (base-16) numbers. Also perform hexadecimal addition of two hex values.

Decimal ↔ Hex Conversion

Hex Addition

About this Calculator

Convert between decimal and hexadecimal (base-16) numbers. Also perform hexadecimal addition of two hex values.

Formula & Calculations

Formula

Decimal to Hex: repeated division by 16. Hex to Decimal: sum of (digit × 16^position). Digits: 0-9, A-F (10-15).
Where:
  • Hexadecimal (Hex)=A base-16 numeral system using digits 0-9 and letters A-F (representing values 10-15)
  • Decimal=The standard base-10 numeral system
  • 0x prefix=Common notation indicating a hexadecimal value (e.g., 0xFF = 255)

Assumptions

  • Decimal inputs must be non-negative integers.
  • Hexadecimal inputs may use uppercase or lowercase letters A-F.
  • Hex addition follows base-16 arithmetic: carry when sum ≥ 16.

Calculation Examples

Example 1

Inputs:Decimal 255 → Hex
Result:FF

255 = 15×16 + 15×1, where 15 is F in hex, so FF.

Example 2

Inputs:Hex: A3 + 1F
Result:0xC2

A3 = 163 decimal, 1F = 31 decimal. 163 + 31 = 194 = C2 hex.

Frequently Asked Questions

Where is hexadecimal used?

Hexadecimal is widely used in computing for memory addresses, color codes (e.g., #FF5733 for RGB), machine code, MAC addresses, and binary data representation because two hex digits represent exactly one byte (8 bits).

How do I convert hex to decimal manually?

Multiply each hex digit by 16 raised to its position (rightmost = position 0). For example, 2A = 2×16^1 + 10×16^0 = 32 + 10 = 42.