What is the hexadecimal number system?
The hexadecimal number system (base 16) is a positional numeral system that uses sixteen symbols to represent numbers. These symbols include the digits from 0 to 9 and the letters from A to F. Each digit represents a power of 16, making it a compact and efficient way to express large numbers, particularly in computing and digital electronics.
In hexadecimal:
- The digits 0–9 represent the values 0 to 9.
- The letters A–F represent the values 10 to 15.
For example:
- A₁₆ = 10₁₀
- F₁₆ = 15₁₀
This base is widely used in programming because it aligns neatly with binary (base 2). Each hexadecimal digit corresponds exactly to four binary digits (bits), making the translation between the two straightforward.
Why hexadecimal is so common in computing
Computers operate using binary data (0s and 1s). However, binary numbers quickly become long and hard to read. Hexadecimal compresses this information without losing precision. For example:
- Binary: 1111 1111 1111 1111
- Hexadecimal: FFFF
Each hexadecimal digit represents a group of four bits. As a result, 8-bit bytes can be compactly represented as two hexadecimal digits.
This usability extends beyond simple data processing—hexadecimal is seen in memory addresses, digital color codes, and machine-level programming.
Formula for conversion
To convert a number from any base system to the hexadecimal system, two main steps are followed:
- Convert the original number to decimal (base 10).
- Convert the decimal number to hexadecimal (base 16).
For converting from decimal to hexadecimal, the following division method is used:
We repeatedly divide the decimal number by 16, recording the remainders at each step. The hexadecimal digits are then read from bottom to top.
Step-by-step examples
Let’s convert 254₁₀ to hexadecimal.
| Division | Quotient | Remainder |
|---|---|---|
| 254 ÷ 16 | 15 | 14 (E) |
| 15 ÷ 16 | 0 | 15 (F) |
Reading remainders from bottom to top: FE
Converting 16₁₀ to hexadecimal
| Division | Quotient | Remainder |
|---|---|---|
| 16 ÷ 16 | 1 | 0 |
| 1 ÷ 16 | 0 | 1 |
Conversion from other number systems
Our converter can handle not just decimal, but any number system from base 2 to base 36.
For example, to convert 213₈ (octal) to hexadecimal
- Convert to decimal:
- Convert 139₁₀ → 8B₁₆
Using the hexadecimal converter
This converter allows seamless conversion between bases from 2 to 36 into hexadecimal. Simply enter your number and select its base system. Results are generated instantly — no extra steps or “calculate” button needed.
The converter automatically recognizes valid characters depending on the base selected:
- For base 2: only 0 and 1 allowed.
- For base 10: digits 0–9.
- For base 16: digits 0–9 and A–F.
- For base 36: digits 0–9 and A–Z.
How hexadecimal is used in colors and web design
In web development, hexadecimal notation plays a vital role in representing colors. Every color on a digital screen is composed of three components — red, green, and blue (RGB) — each ranging from 0 to 255 in decimal. In hexadecimal, this range is 00 to FF.
A color is displayed as a combination of these three pairs:
Example:
- #FF0000 → Pure Red
- #00FF00 → Pure Green
- #0000FF → Pure Blue
- #FFFFFF → White (maximum intensity of all three colors)
- #000000 → Black (no light)
Each pair corresponds to one color channel:
- RR controls the amount of red,
- GG controls the amount of green,
- BB controls the amount of blue.
For example, if you choose #4CAF50:
- 4C₁₆ = 76₁₀ (red component),
- AF₁₆ = 175₁₀ (green component),
- 50₁₆ = 80₁₀ (blue component).
The combination results in a medium green shade.
This compact representation is ideal for developers and designers working with web pages, digital graphics, and user interfaces.
Conversion table for quick reference
| Decimal | Hexadecimal | Decimal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 8 | 8 |
| 1 | 1 | 9 | 9 |
| 2 | 2 | 10 | A |
| 3 | 3 | 11 | B |
| 4 | 4 | 12 | C |
| 5 | 5 | 13 | D |
| 6 | 6 | 14 | E |
| 7 | 7 | 15 | F |
Frequently asked questions
How to convert 125₁₀ to hexadecimal?
| Division | Quotient | Remainder |
|---|---|---|
| 125 ÷ 16 | 7 | 13 (D) |
| 7 ÷ 16 | 0 | 7 |
Reading from bottom to top: 7D
Why does web design use hexadecimal colors instead of decimal?
Hexadecimal enables concise representation of RGB values using only six characters, aligning perfectly with byte-sized values (0–255) in digital color systems.
Convert number 600 to hexadecimal
| Division | Quotient | Remainder |
|---|---|---|
| 600 ÷ 16 | 37 | 8 |
| 37 ÷ 16 | 2 | 5 |
| 2 ÷ 16 | 0 | 2 |
Reading from bottom to top: 258