Hex โ Decimal Converter
Convert between hexadecimal and decimal instantly
๐ Hexadecimal to Decimal Conversion
What is Hexadecimal?
Hexadecimal (base-16) uses 16 symbols: 0-9 and A-F. Each hex digit represents 4 bits.
A = 10, B = 11, C = 12
D = 13, E = 14, F = 15
Hex to Decimal Formula
Multiply each hex digit by 16โฟ (where n is digit position from right, starting at 0)
Decimal to Hex Formula
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:
- Hex โ Decimal: Type hex value, decimal updates automatically
- Decimal โ Hex: Type decimal value, hex updates automatically
- Real-time validation: Invalid hex shows error message
- Auto-formatting: Hex input automatically capitalized
// 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
A: Hexadecimal is commonly used in computer programming, memory addressing, color codes (like #FFFFFF for white), and debugging.
A: No, this converter automatically converts lowercase letters to uppercase. "ff", "FF", and "Ff" all convert to 255.
A: This converter handles up to 20 hex digits or decimal numbers up to 1,099,511,627,775.
A: This converter only handles positive numbers. For negative numbers (like two's complement), you'd need a specialized converter.