Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal. See the value in all 4 bases at once.
About the Number Base Converter
Computers operate in binary (base-2), but humans prefer decimal (base-10). Hexadecimal (base-16) is used in programming for memory addresses, color codes, and low-level data representation. Octal (base-8) appears in Unix file permissions. This converter handles all common number bases and shows the step-by-step conversion - essential for computer science students and programmers working close to the hardware.
Number Base Conversion
Decimal to binary: divide repeatedly by 2, read remainders bottom-up · Binary to decimal: sum of (bit × 2^position)
Binary digits: 0, 1 · Octal digits: 0-7 · Hexadecimal: 0-9, A(10), B(11), C(12), D(13), E(14), F(15) · 1 hex digit = 4 binary digits (nibble) · FF hex = 255 decimal = 11111111 binary
Worked Example
HTML color code #FF6B35 - what are the RGB decimal values?
RGB(255, 107, 53) - a vibrant orange · Binary FF = 11111111 · Binary 6B = 01101011
Tips & Insights
- 1
Unix file permissions 755 (octal) = 111 101 101 (binary) = read/write/execute for owner, read/execute for group and others.
- 2
IP addresses are 32-bit binary numbers typically shown as 4 decimal octets (192.168.1.1).
- 3
Hexadecimal makes binary more readable: every two hex digits = one byte = 8 bits.
- 4
Web colour codes (#FF5733) are hexadecimal: FF = 255 red, 57 = 87 green, 33 = 51 blue. Breaking a hex colour into its RGB components is routine for developers and designers working between design tools and code.
- 5
Bitwise AND is used for masking: value AND mask extracts specific bits. AND with 0xFF isolates the lowest byte of any integer.
- 6
XOR has a useful property: a XOR b XOR b = a. This is used in simple encryption, swap algorithms (without a temp variable), and error detection in RAID storage.
- 7
The number of bits required to represent N distinct values is ceil(log2(N)). For 256 values you need 8 bits (1 byte); for 1024 values you need 10 bits.
Why this matters for you
Computer science students encounter multiple number bases in every hardware and low-level programming course. Exam questions on binary, hex, and octal conversions appear regularly in BCA, B.Tech CS, and GATE CS curriculum. Understanding base conversion is not just an academic exercise - it is the foundation for reading memory dumps, interpreting protocol headers, and writing low-level device drivers.
For web developers, hex is everywhere: color codes, Unicode escape sequences, HTTP status codes, CSS transforms, and cryptographic hashes are all expressed in hexadecimal. A developer who can mentally parse #1a1a2e as a very dark navy blue, or read a SHA-256 hash without confusion, works faster and makes fewer errors than one who treats hex as mysterious.
Bitwise operations - AND, OR, XOR, and bit shifts - are the building blocks of flags, masks, permissions, and optimizations in systems programming. They appear in embedded systems (sensor bit fields), networking (subnet masks, port fields), databases (bitmap indexes), and competitive programming. Practicing conversions and bitwise logic builds the mental model needed for any role that touches hardware, networking, or performance-critical software.
Related Calculators
Scientific
Full scientific calculator with trigonometry, logarithms, powers, and constants. Supports both DEG and RAD modes.
Prime Checker
Check if a number is prime and get its prime factorization, all divisors, and the nearest prime numbers.
GCD & LCM
Find the Greatest Common Divisor and Least Common Multiple of two or more numbers with step-by-step working.