Understanding Number Systems
Computers and humans think about numbers differently. We use the decimal system (base 10) with digits 0-9, but computers work in binary (base 2) with just 0 and 1. Hexadecimal (base 16) and octal (base 8) bridge the gap — they’re compact ways to represent binary data in a human-readable format.
| System | Base | Digits | Common Use |
|---|---|---|---|
| Binary | 2 | 0, 1 | Computer logic, networking |
| Octal | 8 | 0-7 | Unix file permissions |
| Decimal | 10 | 0-9 | Everyday counting |
| Hexadecimal | 16 | 0-9, A-F | Colors, memory addresses |
Hex to Decimal Conversion
Each hex digit represents a power of 16. To convert 0xFF to decimal:
F = 15, F = 15
0xFF = (15 × 16¹) + (15 × 16⁰)
= (15 × 16) + (15 × 1)
= 240 + 15
= 255
Hex Color Codes
Web developers use hex codes for colors. Each pair of hex digits represents red, green, and blue (0-255):
| Color | Hex Code | RGB Decimal |
|---|---|---|
| White | #FFFFFF | 255, 255, 255 |
| Black | #000000 | 0, 0, 0 |
| Red | #FF0000 | 255, 0, 0 |
| Green | #00FF00 | 0, 255, 0 |
| Blue | #0000FF | 0, 0, 255 |
| Yellow | #FFFF00 | 255, 255, 0 |
Binary to Decimal Conversion
Each binary digit (bit) represents a power of 2. To convert 11010 to decimal:
1×2⁴ + 1×2³ + 0×2² + 1×2¹ + 0×2⁰
= 16 + 8 + 0 + 2 + 0
= 26
How Computers Use Binary
All data in a computer is ultimately binary — a sequence of 0s and 1s. Each 0 or 1 is a bit, and 8 bits make a byte. Understanding binary helps with:
- Networking: IP addresses and subnet masks
- File sizes: Why 1 KB is 1024 bytes (2¹⁰)
- Permissions: Unix chmod values
- Programming: Bitwise operations and flags
For file size conversions, see our byte converter.
Octal to Decimal Conversion
Octal uses powers of 8. To convert 377 (octal) to decimal:
3×8² + 7×8¹ + 7×8⁰
= 192 + 56 + 7
= 255
Unix File Permissions
Octal is used for Unix/Linux file permissions:
| Octal | Binary | Permission |
|---|---|---|
| 7 | 111 | Read + Write + Execute |
| 6 | 110 | Read + Write |
| 5 | 101 | Read + Execute |
| 4 | 100 | Read only |
| 0 | 000 | No permission |
chmod 755 means: owner gets rwx (7), group gets r-x (5), others get r-x (5).
Quick Reference Table
| Decimal | Hex | Binary | Octal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 8 | 8 | 1000 | 10 |
| 10 | A | 1010 | 12 |
| 15 | F | 1111 | 17 |
| 16 | 10 | 10000 | 20 |
| 32 | 20 | 100000 | 40 |
| 64 | 40 | 1000000 | 100 |
| 128 | 80 | 10000000 | 200 |
| 255 | FF | 11111111 | 377 |
| 256 | 100 | 100000000 | 400 |
Free Hex Decimal Binary Converter
Convert between decimal, hexadecimal, binary, and octal number systems.
©2026 Notes Calculator. All rights reserved.
Example
Convert 0xA3 (hex) to decimal:
A = 10, 3 = 3
0xA3 = (10 × 16) + (3 × 1)
= 160 + 3
= 163
Frequently Asked Questions
How do I convert hex to decimal?
Multiply each hex digit by its positional power of 16, then add the results. Hex digits A-F represent values 10-15. For example, hex 1A = (1 x 16) + (10 x 1) = 26 in decimal. For larger numbers, continue with higher powers: 16², 16³, and so on.
Why do programmers use hexadecimal?
Hexadecimal is a compact way to represent binary data. Each hex digit maps to exactly 4 binary digits (bits), making conversion simple. For example, 0xFF = 11111111 in binary. This makes hex ideal for memory addresses, color codes, and byte values, which would be very long in binary.
What is the difference between binary and decimal?
Decimal (base 10) uses digits 0-9 and is what humans use daily. Binary (base 2) uses only 0 and 1 and is how computers process data. Binary is less readable but directly represents electrical states (on/off) in computer circuits. Every decimal number has a binary equivalent.
For Mac users looking for a calculator with built-in base conversion, check our best calculator apps for Mac comparison.
Convert Number Bases in Notes Calculator
Notes Calculator converts between decimal, hexadecimal, binary, and octal using natural syntax:
# Number Base Conversions
255 in hex
255 in binary
255 in octal
// Hex to decimal
0xFF in decimal
// Binary to decimal
0b11010 in decimal
// Arithmetic across bases
0xFF + 1 in hex
0b1010 + 0b0101 in binary
// Web color values
red = 0xFF
green = 0x80
blue = 0x00
Use hex, binary, octal, and decimal keywords (or their short forms ₁₆, ₂, ₈, ₁₀) to convert freely between systems. You can even do arithmetic across bases — Notes Calculator handles the conversion automatically.