Base Converter

Convert numbers between different number bases (2-36). Free online base converter supporting binary, octal, decimal, hexadecimal and any base up to 36.

Calculation steps

Decimal to base 16 calculation:

Divide by the base to get the digits from the remainders:

DivisionQuotient

Remainder

(Digit)
Digit #

Base Converter - Convert Numbers Between Different Number Systems

This powerful base converter allows you to convert numbers between any number base from 2 to 36. Whether you're working with binary (base 2), octal (base 8), decimal (base 10), hexadecimal (base 16), or any other number system, this tool provides instant conversions with detailed calculation steps.

What is hexadecimal (base 16) and why is it used in programming?

Hexadecimal, or hex, is a base-16 number system using 16 distinct symbols: digits 0-9 followed by letters A-F (where A=10, B=11, C=12, D=13, E=14, F=15). Programmers use hex because it maps perfectly to binary: each hex digit represents exactly 4 binary bits, so one byte (8 bits) becomes exactly two hex characters. The number 255 (the maximum byte value) is FF in hex, much more compact than 11111111 in binary. Hex appears everywhere in computing: memory addresses (0x7FFE), HTML colors (#FF5733 red), MAC addresses (00:1B:44:11:3A:B7), error codes, and assembly language. The 0x prefix denotes hex in C, Python, JavaScript and most programming languages. Hex is just a shorthand for binary — the computer always works in binary, hex just makes it human-readable.

How do I convert binary (base 2) to decimal (base 10) by hand?

Each binary digit (bit) represents a power of 2, starting from 2^0 on the right and doubling as you move left. To convert, multiply each bit by its corresponding power of 2 and sum the results. Example: binary 1011 = (1 times 8) + (0 times 4) + (1 times 2) + (1 times 1) = 8 + 0 + 2 + 1 = 11 in decimal. Another example: binary 11010100 = 128 + 64 + 0 + 16 + 0 + 4 + 0 + 0 = 212. The bit positions are 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, doubling forever. Memorize these powers of 2 up to 1024 and binary conversion becomes very fast. Going the other way, repeatedly divide the decimal by 2, recording remainders, and read them from bottom to top — that gives you the binary representation.

What is octal (base 8) and is it still used today?

Octal is a base-8 number system using digits 0 through 7. Each octal digit represents exactly 3 binary bits, making octal a compact way to write binary before hex became dominant. Octal was widely used on older 12-bit and 36-bit computer architectures (PDP-8, PDP-10, IBM mainframes) where word sizes divided evenly by 3. Today octal is largely replaced by hex but persists in two important places: Unix/Linux file permissions (chmod 755 means rwx r-x r-x in octal where each digit is 3 permission bits), and in some C/C++ code where a leading zero indicates octal (077 = 63 decimal, not 77). Be careful: 010 in C is decimal 8, not 10 — a classic source of bugs. JavaScript dropped legacy octal but supports 0o10 syntax for clarity.

What is the largest base supported by this converter and why?

This tool supports bases from 2 (binary) up to 36 (alphanumeric). Base 36 is the largest base writeable using only the standard alphanumeric characters: digits 0-9 (10 symbols) plus letters A-Z (26 symbols), totaling 36 symbols. The number 35 in base 36 is Z, 36 is 10, 100 in base 36 equals 1296 in decimal. Base 36 is occasionally used for URL shorteners and compact ID encoding because it produces shorter strings than base 10. Beyond base 36, encoding systems use additional symbols: base 58 (Bitcoin addresses, excludes confusing chars like 0/O and 1/l), base 62 (case-sensitive alphanumeric, 10 + 26 + 26), base 64 (RFC 4648, adds + and /), base 85 (Adobe ASCII85), and base 91 (efficient text encoding). Beyond ~256, you run out of printable ASCII characters.

Base Converter — Convert numbers between different number bases (2-36). Free online base converter supporting binary, octal, decimal, hex
Base Converter

How does the conversion algorithm actually work step by step?

Converting between arbitrary bases uses decimal as a common intermediate. Step 1, source-to-decimal: multiply each digit by the source base raised to its position power (rightmost is position 0). Hex 2F = (2 times 16^1) + (15 times 16^0) = 32 + 15 = 47. Step 2, decimal-to-target: repeatedly divide by the target base, recording remainders, then read remainders bottom-up. Decimal 47 to binary: 47/2=23 r1, 23/2=11 r1, 11/2=5 r1, 5/2=2 r1, 2/2=1 r0, 1/2=0 r1. Reading bottom-up: 101111. Verify: 32+0+8+4+2+1=47. For very large numbers, this calculator uses BigInt arithmetic so there is no overflow at the JavaScript number limit (2^53). For decimals/fractions, multiply the fractional part by the target base instead of dividing.

Why is binary (base 2) the foundation of all digital computers?

Binary uses only two symbols (0 and 1), which maps perfectly to the two stable states of an electronic switch: off/on, low-voltage/high-voltage, no-current/current. This binary nature is what makes digital circuits reliable — a transistor is either fully on or fully off, with no ambiguous middle states that could be misread. Claude Shannon proved in 1937 that any Boolean logic can be implemented with binary switches, and George Boole had developed the underlying logical algebra in 1854. While early experimental ternary (base-3) computers existed (the Soviet Setun in 1958), they offered no practical advantage and required more complex circuits. Quantum computers use qubits which superpose 0 and 1, but still ultimately collapse to binary measurement. Every photo, video, document, and program on your devices is ultimately a long string of 0s and 1s.

What is two's complement and how are negative numbers stored in binary?

Computers use two's complement to represent negative numbers in binary, where the leftmost bit indicates sign (0 = positive, 1 = negative). To negate a number: flip all bits, then add 1. For example, in 8-bit two's complement: +5 is 00000101, -5 is 11111011 (flip to 11111010, add 1). This system has one zero (not +0 and -0), supports the same addition circuit for signed and unsigned, and gives one extra negative value (8 bits range -128 to +127). Two's complement explains why integer overflow in C wraps around: 127 + 1 in signed 8-bit becomes -128, not 128. The largest positive value in n bits is 2^(n-1) - 1, the smallest is -2^(n-1). 32-bit signed integers range from about -2.1 billion to +2.1 billion, 64-bit from about -9.2 quintillion to +9.2 quintillion.

What is the difference between base encoding (Base64) and base conversion?

Base conversion changes how a single number is written: 255 in base 10 equals FF in base 16 equals 11111111 in base 2 — same value, different notation. Base encoding (like Base64, Base58, Base85) is different: it encodes arbitrary binary data as printable text characters, used for email attachments (MIME), URLs, JSON Web Tokens, image embedding (data:image/png;base64,...) and Bitcoin addresses. Base64 takes 3 bytes (24 bits) and outputs 4 characters from a 64-symbol alphabet (A-Z, a-z, 0-9, +, /), increasing size by 33% but ensuring safe transmission through systems that only handle text. Base32 (RFC 4648) is used in TOTP authenticator codes. Base58 (Bitcoin) excludes visually ambiguous characters 0/O/I/l. This converter handles base conversion (changing how a number is written), not base encoding (converting binary data to text).

Common Number Base Reference

DecimalBinaryOctalHexadecimalBase 36
00000
11111
210222
311333
4100444
5101555
6110666
7111777
810001088
910011199
10101012AA
15111117FF
16100002010G
3111111371FV
321000004020W
351000114323Z
36100100442410
25511111111377FF73
1000111110100017503E8RS