Number Base Converter
Convert between binary, octal, decimal, and hexadecimal.
Frequently Asked Questions
How do I convert binary to decimal?
Each binary digit (bit) represents a power of 2, starting from 2⁰ at the right. Example: binary 1011 = (1×2³) + (0×2²) + (1×2¹) + (1×2⁰) = 8 + 0 + 2 + 1 = 11 decimal.
What is hexadecimal and why is it used in programming?
Hexadecimal (base 16) uses digits 0–9 and letters A–F. Each hex digit represents exactly 4 binary bits, so hex is a compact way to express binary data. It appears in: colour codes (#FF5733), memory addresses (0x7FFF), HTML/CSS, MAC addresses, and file hex editors.
How do I convert decimal to binary?
Repeatedly divide the decimal number by 2 and record the remainders. Reading remainders from bottom to top gives the binary result. Example: 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1. Reading remainders up: 1101.
What is the largest number that fits in common data types?
An 8-bit byte holds 0–255 (unsigned) or −128 to 127 (signed). A 16-bit integer: 0–65,535 unsigned. A 32-bit integer: 0–4,294,967,295. A 64-bit integer: ~1.8 × 10¹⁹. This is why old 32-bit systems had the Year 2038 Unix timestamp problem — the max signed 32-bit timestamp corresponds to January 19, 2038.