Hex ⇄ Decimal
Convert between hexadecimal and decimal numbers. Supports uppercase and lowercase hex input — useful for color codes, memory addresses, and network protocols.
How to use the hex ⇄ decimal
Hex digits 0–9, A–F. Case insensitive.
Formula & explanation
Each hex digit represents 4 bits.
Examples
FF = 255. 1A = 26. C0FFEE = 12,648,430.
Frequently asked questions
- What is hexadecimal used for?
- Hex is used in programming for memory addresses, color codes (e.g. #FF5733), and representing binary data compactly — each hex digit maps to exactly 4 bits.
- How do I convert hex to decimal?
- Multiply each hex digit by 16 raised to its positional power and sum the results. For example, 1A = (1 × 16) + (10 × 1) = 26.
- What letters are used in hexadecimal?
- Hex uses digits 0–9 and letters A–F, where A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15. Input is case-insensitive.
- Why do CSS color codes use hex?
- RGB colors pack three 0–255 values into a compact 6-digit hex string (2 digits per channel), making them easy to read and copy in code and design tools.
Related number & code tools
- Binary ⇄ HexConvert between binary and hexadecimal notation. Handles any length input and groups binary output into nibbles (4-bit groups) for readability.
- Octal ⇄ DecimalConvert between octal (base 8) and decimal (base 10). Useful for Unix file permissions, legacy computing, and programming exercises involving number systems.
- Binary ⇄ DecimalConvert between binary and decimal numbers in both directions. Supports signed integers and shows the step-by-step positional value breakdown for each conversion.
- Number Base ConverterConvert any number between any two bases from 2 (binary) to 36. Enter the source base, target base, and number — ideal for computer science and custom encoding schemes.
- BCD ConverterConvert decimal numbers to Binary-Coded Decimal (BCD) and back. Shows the 4-bit group encoding for each decimal digit — useful for electronics and embedded systems.
- ASCII ConverterConvert text to ASCII character codes and ASCII codes back to text. Shows decimal, hexadecimal, and binary representations for each character simultaneously.