Wide Tools

Number Base Converter

Convert between decimal, binary, hexadecimal, and octal instantly. Bitwise AND, OR, XOR operations. Perfect for programmers and CS students.

Why computers speak binary

The choice of binary in computing wasn't arbitrary — it was physical necessity. Transistors are electronic switches with two reliable states: conducting current (1) or blocking it (0). Engineering circuits that reliably distinguish ten states (decimal) would be orders of magnitude harder than two. Claude Shannon's 1948 paper "A Mathematical Theory of Communication" formalized the bit as the fundamental unit of information, cementing binary as the language of digital computing.

Hexadecimal emerged as a human-friendly bridge. Since 16 = 2⁴, each hex digit maps to exactly 4 bits. This means a byte (8 bits) always compresses to exactly 2 hex digits — much easier to read than 8 binary digits. Programmers, security researchers, and hardware engineers read hex fluently. Memory addresses like 0x7FFE4000, color codes like #1A2B3C, and SHA-256 hashes are all hexadecimal.

Bitwise operations in software

AND, OR, and XOR are the workhorses of low-level programming. Unix file permissions use bitwise flags (read=4, write=2, execute=1). Game engines use bitmasks to track player states. Cryptographic algorithms like AES rely heavily on XOR. Network subnet masks are AND operations. Understanding bitwise operations bridges the gap between high-level code and the silicon beneath it.

Source: Shannon, C.E. — "A Mathematical Theory of Communication" (1948); Knuth, D.E. — "The Art of Computer Programming"; IEEE Std 754.

Frequently asked questions

What is a number base?
A number base (or radix) is the count of unique digits used to represent numbers. Decimal (base 10) uses 0–9. Binary (base 2) uses 0–1. Hexadecimal (base 16) uses 0–9 and A–F. Octal (base 8) uses 0–7.
How do I convert decimal to binary?
Divide the number by 2 repeatedly, recording remainders bottom-to-top. Example: 13 → 13÷2=6 R1, 6÷2=3 R0, 3÷2=1 R1, 1÷2=0 R1 → binary: 1101. Or use the calculator above for instant results.
Why is hexadecimal used in programming?
Each hex digit represents exactly 4 bits (half a byte), making hex much more compact than binary. The byte 11111111 in binary is just FF in hex. Hex is used for memory addresses, colors (#FF5733), hardware registers, and cryptographic hashes.
What are bitwise operations (AND, OR, XOR)?
They operate on individual bits of two numbers. AND outputs 1 only when both bits are 1. OR outputs 1 when at least one bit is 1. XOR outputs 1 when bits differ. Used in permission flags (Unix chmod), bitmasks, cryptography, and low-level optimization.
Why do computers use binary?
Transistors have two reliable physical states: conducting (1) or blocking (0). It's far simpler to engineer circuits that distinguish two states than ten. Claude Shannon formalized this in 1948 with information theory, establishing the bit as the fundamental unit of digital information.
How do I convert hexadecimal to decimal?
Multiply each hex digit by its positional value (power of 16). Example: FF = (15 × 16¹) + (15 × 16⁰) = 240 + 15 = 255. Remember: A=10, B=11, C=12, D=13, E=14, F=15.

Other calculators

Was this tool helpful?

Get updates

We'll let you know when we launch new tools. No spam.