Last updated
Number Base Converter Examples
The Number Base Converter converts numbers between binary, octal, decimal, hexadecimal, and any custom base from 2 to 36. Below are examples of common conversions.
Decimal to All Common Bases
Input: 255 (decimal)
Binary (base 2): 11111111
Octal (base 8): 377
Decimal (base 10): 255
Hexadecimal (base 16): FF
Input: 1024 (decimal)
Binary: 10000000000
Octal: 2000
Decimal: 1024
Hexadecimal: 400
Step-by-Step: Decimal to Binary
Convert 42 to binary:
42 ÷ 2 = 21 remainder 0
21 ÷ 2 = 10 remainder 1
10 ÷ 2 = 5 remainder 0
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1
Read remainders bottom to top: 101010
42 decimal = 101010 binary
Step-by-Step: Binary to Decimal
Convert 101010 to decimal:
Position: 5 4 3 2 1 0
Bit: 1 0 1 0 1 0
Value: 32 0 8 0 2 0
32 + 8 + 2 = 42
101010 binary = 42 decimal
Hexadecimal Conversions
Hex → Decimal:
FF = 255
1A = 26
DEAD = 57,005
CAFE = 51,966
0x1F4 = 500
Decimal → Hex:
16 = 10
256 = 100
65535 = FFFF
16777215 = FFFFFF
CSS Color Code Decoding
#FF5733 decoded:
R = FF = 255
G = 57 = 87
B = 33 = 51
RGB(255, 87, 51) — a warm orange-red
#3B82F6 decoded:
R = 3B = 59
G = 82 = 130
B = F6 = 246
RGB(59, 130, 246) — Tailwind blue-500
Two's Complement (Negative Numbers)
-1 in 8-bit two's complement:
Step 1: 1 in binary = 00000001
Step 2: Invert bits = 11111110
Step 3: Add 1 = 11111111
-1 = 11111111 (binary) = FF (hex)
-128 in 8-bit two's complement:
= 10000000 (binary) = 80 (hex)
Range for 8-bit signed integer: -128 to 127
IP Address Binary Representation
192.168.1.1 in binary:
192 = 11000000
168 = 10101000
1 = 00000001
1 = 00000001
Full binary: 11000000.10101000.00000001.00000001
Subnet mask /24 = 255.255.255.0
Binary: 11111111.11111111.11111111.00000000
ASCII / Unicode Code Points
Character → Code Point:
'A' = 65 decimal = 41 hex = 1000001 binary
'a' = 97 decimal = 61 hex = 1100001 binary
'0' = 48 decimal = 30 hex = 110000 binary
'€' = 8364 decimal = 20AC hex
'😀' = 128512 decimal = 1F600 hex (U+1F600)
Custom Base Conversions
Base 12 (duodecimal):
12 decimal = 10 (base 12)
144 decimal = 100 (base 12)
Base 36 (alphanumeric):
35 decimal = Z (base 36)
36 decimal = 10 (base 36)
1000 decimal = RS (base 36)
Base 60 (sexagesimal — used in time/angles):
3600 decimal = 1:0:0 (1 hour = 60 minutes × 60 seconds)
Common Use Cases
- Converting decimal values to binary for bitwise operations
- Decoding CSS hex color codes to RGB values
- Reading memory addresses and binary file formats in hex
- Understanding IP addresses and subnet masks in binary
- Learning number systems for computer science courses
- Converting ASCII and Unicode code points
- Working with embedded systems and low-level programming
Enter any number in any base and get instant conversions to binary, octal, decimal, and hexadecimal, with step-by-step explanations of the conversion process.