BasicApps Logo
Integer Base Converter

Convert numbers between different bases (2-64)

Enter a number in the source base format

Four number bases sounds like a lot until you understand what each one is actually for

Decimal is what people use day-to-day. Binary is what the hardware uses — transistors are either on or off, which is exactly two states, which is exactly base 2. Those two facts explain most of what you see in computing. Hexadecimal exists because binary is unreadable at human scale: one hex digit maps to exactly four binary bits, so a full byte fits neatly into two hex characters. Octal hung around mainly because Unix file permissions — read, write, execute for owner, group, others — fit into three octal digits. That's the whole story. Four bases, four reasons.

Binary — Base 2

Digits: 0, 1
Prefix: 0b in most languages
Example: 0b11001101 = 205

Octal — Base 8

Digits: 0–7
Prefix: 0o or a leading 0
Example: 0o755 = rwxr-xr-x

Decimal — Base 10

Digits: 0–9
Prefix: none
Example: 255 = one full byte

Hexadecimal — Base 16

Digits: 0–9, A–F
Prefix: 0x
Example: 0xFF = 255

Why URL shorteners and order IDs use base 36

Base 36 packs digits 0–9 and letters A–Z into 36 case-insensitive symbols, all of them safe to type, say out loud, or send in a text. The number 1,000,000 in base 36 is LFLS — four characters instead of seven. URL shorteners love this. So do order-tracking systems where customers have to read a code off a receipt. The tricky part is choosing your symbol set carefully: some systems exclude 0 and O, or I and 1, because people confuse them. Decide on your alphabet before you go live. Changing it after means breaking every existing ID.

Two's complement: why negative numbers in binary look so strange

Negative integers aren't stored with a minus sign. The hardware uses two's complement: flip every bit in the positive representation, then add 1. For an 8-bit signed byte, −1 is 11111111. The value −128 is 10000000. This was a deliberate design choice because it lets the CPU subtract numbers using the same circuit it uses for addition — no dedicated subtraction hardware needed. The catch you run into in practice: 0xFFFFFFFF in a 32-bit signed integer is −1, not 4,294,967,295. Whether you get the signed or unsigned interpretation depends entirely on the type declaration in your language.