Hex โ†” Decimal Converter

Convert between hexadecimal and decimal instantly

Valid hex digits: 0-9, A-F
Enter decimal number (0-4294967295)
Conversion Result
FF (hex) = 255 (decimal)
Binary: 11111111 โ€ข Octal: 377 โ€ข Bits: 8

๐Ÿ“š Hexadecimal to Decimal Conversion

What is Hexadecimal?

Hexadecimal (base-16) uses 16 symbols: 0-9 and A-F. Each hex digit represents 4 bits.

0-9 = 0-9
A = 10, B = 11, C = 12
D = 13, E = 14, F = 15

Hex to Decimal Formula

decimal = dโ‚€ร—16โฐ + dโ‚ร—16ยน + dโ‚‚ร—16ยฒ + ...

Multiply each hex digit by 16โฟ (where n is digit position from right, starting at 0)

Decimal to Hex Formula

Keep dividing by 16,
remainders give hex digits

Divide decimal by 16 repeatedly, collect remainders as hex digits (in reverse order).

Common Uses

  • Computer programming
  • Color codes (RGB/HEX)
  • Memory addresses
  • Error codes

๐Ÿ“ How This Converter Works

This is a bidirectional converter that works in real-time:

  1. Hex โ†’ Decimal: Type hex value, decimal updates automatically
  2. Decimal โ†’ Hex: Type decimal value, hex updates automatically
  3. Real-time validation: Invalid hex shows error message
  4. Auto-formatting: Hex input automatically capitalized
// Hex to Decimal Conversion Example:
// Convert "1A3F" to decimal:
// 1ร—16ยณ + Aร—16ยฒ + 3ร—16ยน + Fร—16โฐ
// = 1ร—4096 + 10ร—256 + 3ร—16 + 15ร—1
// = 4096 + 2560 + 48 + 15
// = 6719

๐Ÿ“Š Conversion Examples

Hexadecimal Decimal Binary Description
F 15 1111 Single hex digit
FF 255 11111111 Byte value (8 bits)
100 256 100000000 Power of 16
3E8 1000 1111101000 One thousand
FFFF 65535 1111111111111111 16-bit maximum
FFFFFF 16777215 111111111111111111111111 24-bit color (RGB)

โ“ Frequently Asked Questions

Q: What is hexadecimal used for?

A: Hexadecimal is commonly used in computer programming, memory addressing, color codes (like #FFFFFF for white), and debugging.

Q: Does case matter for hex input?

A: No, this converter automatically converts lowercase letters to uppercase. "ff", "FF", and "Ff" all convert to 255.

Q: What's the largest number I can convert?

A: This converter handles up to 20 hex digits or decimal numbers up to 1,099,511,627,775.

Q: Can I convert negative hex numbers?

A: This converter only handles positive numbers. For negative numbers (like two's complement), you'd need a specialized converter.