Number Base Converter
Binary · Decimal · Hex · Octal · Any base 2–36
Decimal (Base 10)
Enter a number above
Binary (Base 2)
Enter a number above
Hexadecimal (Base 16)
Enter a number above
Octal (Base 8)
Enter a number above
Custom Base Conversion
Base
Result
Range: Base 2–36 · Digits: 0–9, A–Z · Click result to copy
Step-by-step Conversion
▼
Number Base Questions
What are number bases and why do computers use binary?+
A number base (or radix) defines how many unique digits a number system uses. Base 10 (decimal) uses digits 0–9 and is what humans use daily. Base 2 (binary) uses only 0 and 1. Computers use binary because electronic circuits have two stable states: off (0) and on (1), corresponding to low and high voltage. Every number, letter, image, and sound in a computer is ultimately stored as a sequence of 0s and 1s. Modern CPUs process 64-bit (64 binary digit) numbers in a single clock cycle. The number 255 in decimal is
11111111 in binary — 8 bits, or one byte.How do I convert decimal to binary by hand?+
Divide the decimal number by 2 repeatedly and record the remainders from bottom to top. Example: 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. Verify: 32+8+2 = 42. This tool shows the exact division steps for any number. The "Step-by-step Conversion" section above walks through each division for the number you enter.What is hexadecimal and why do programmers use it?+
Hexadecimal (base 16) uses digits 0–9 and letters A–F (where A=10, B=11, C=12, D=13, E=14, F=15). Programmers use hex because one hex digit represents exactly 4 binary bits (a nibble), and two hex digits represent one byte (8 bits). This makes it very compact for representing binary data. Examples: the color
#FF5733 is three bytes (R=255, G=87, B=51). Memory addresses like 0x7FFE4000 are easier to read than binary. The prefix 0x indicates hex in most programming languages. 256 bytes = 0x100 in hex = 100000000 in binary.What is a bit, byte, kilobyte, and megabyte?+
A bit is a single binary digit (0 or 1). A nibble is 4 bits. A byte is 8 bits and can represent values 0–255. A kilobyte (KB) is 1,024 bytes (2^10). A megabyte (MB) is 1,024 KB = 1,048,576 bytes. A gigabyte (GB) is 1,024 MB. A terabyte (TB) is 1,024 GB. Note: hard drive manufacturers use 1,000-based definitions (SI), which is why a "1TB" drive shows as ~931 GB in Windows. The IEC introduced kibibyte (KiB), mebibyte (MiB) etc. for the powers-of-2 definitions, but "KB", "MB" are still widely used for both.
How does octal (base 8) relate to binary and Unix permissions?+
One octal digit represents exactly 3 binary bits. This made octal popular in early computing when 12-bit, 24-bit, and 36-bit word sizes were common (all divisible by 3). Today octal is mainly used for Unix/Linux file permissions. The
chmod 755 command uses octal: 7 = 111 (read+write+execute), 5 = 101 (read+execute). The three digits represent Owner, Group, and Others permissions. chmod 644 = Owner read+write (110=6), Group read-only (100=4), Others read-only (100=4). chmod 777 gives full permissions to everyone. Octal is also used in some network protocols and escape sequences (\077 in C).What is two's complement and how do computers represent negative numbers?+
Two's complement is the standard way computers represent negative integers in binary. To negate a number: flip all bits (one's complement), then add 1. Example: +5 in 8-bit binary =
00000101. Flip bits: 11111010. Add 1: 11111011 = -5. In an 8-bit signed integer, the range is -128 to +127. The most significant bit (leftmost) is the sign bit: 0 = positive, 1 = negative. Two's complement is elegant because addition and subtraction use the same hardware circuit regardless of sign. 5 + (-5) = 00000101 + 11111011 = 100000000 (the overflow bit is discarded) = 0. This tool shows unsigned values only.What is Base 64 and is it the same as base 36?+
Base 36 uses digits 0–9 and letters A–Z (case-insensitive), giving 36 possible digits. It is used for compact human-readable identifiers, URL shorteners, and some UUID implementations. This converter supports Base 36. Base 64 is different: it uses 0–9, A–Z, a–z, +, and / (64 symbols total) and is used specifically for encoding binary data (images, files) as ASCII text in emails and web contexts (data URIs). The Base64 standard (
data:image/png;base64,...) is not the same as counting in base 64 — it is an encoding scheme. This converter supports mathematical base conversion up to Base 36 (the maximum using standard alphanumeric digits).What are common hex values programmers should know?+
Key hex values:
0xFF = 255 (max unsigned byte, all bits set). 0x00 = 0. 0x80 = 128 (most significant bit set in a byte). 0xDEADBEEF = a classic placeholder/debug value. 0xCAFEBABE = Java class file magic number. 0x7FFFFFFF = 2,147,483,647 (max positive 32-bit signed int). 0xFFFFFFFF = 4,294,967,295 (max unsigned 32-bit int). 0x00000000 = null pointer. #FFFFFF = white in CSS. #000000 = black. #FF0000 = pure red. Memory addresses on 64-bit systems are 16 hex digits long (e.g., 0x00007FFF5FBFF888).How do I convert hex to RGB color values?+
A CSS hex color like
#A3B4C5 is three bytes: R=A3, G=B4, B=C5. Convert each byte from hex to decimal: A3 = 10×16+3 = 163. B4 = 11×16+4 = 180. C5 = 12×16+5 = 197. So #A3B4C5 = rgb(163, 180, 197). Short hex colors like #FFF expand to #FFFFFF (each digit is doubled). Use this converter: enter A3 in the input, set base 16, read the decimal result = 163. Repeat for B4 and C5. Alternatively, parseInt("A3", 16) in JavaScript returns 163 directly.What are bitwise operations and how are they used?+
Bitwise operations work on individual bits of integers. AND (
&): both bits must be 1. OR (|): either bit is 1. XOR (^): bits are different. NOT (~): flips all bits. Left shift (<<): multiplies by 2 per shift. Right shift (>>): divides by 2 per shift. Common uses: n & 1 checks if n is odd (last bit). n & (n-1) clears the lowest set bit (checks if n is a power of 2 when result is 0). 1 << n computes 2^n efficiently. x | 0x20 converts an uppercase ASCII letter to lowercase (sets bit 5). Bitwise ops are critical in networking (IP masking), cryptography, graphics, and embedded systems.