Number Base Converter
Convert numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Free number system converter.
About the Number Base Converter
A number base converter translates numbers between decimal (base 10), binary (base 2), octal (base 8), hexadecimal (base 16), and any custom base from 2 to 36. Every number is just a quantity expressed using a particular counting system — the number 255 in decimal is 11111111 in binary, FF in hexadecimal, and 377 in octal. All four represent the exact same value; only the representation differs. Understanding base conversion illuminates how computers store and process all information at the fundamental hardware level, why hexadecimal is used as shorthand for binary, and the elegant mathematical universality of positional number systems. Our base converter shows the full conversion process step by step, supports fractional numbers in different bases, and handles very large numbers that overflow typical calculator limits.
Formula
Any base to decimal: sum(digit x base^position) | Decimal to base: repeated division, read remainders upward
How It Works
Any base to decimal: multiply each digit by its base raised to the position power and sum. Binary 1011 = 1x2^3 + 0x2^2 + 1x2^1 + 1x2^0 = 8+0+2+1 = 11. Hex A3F = 10x16^2 + 3x16^1 + 15x16^0 = 2560+48+15 = 2,623. Decimal to any base: repeatedly divide by the target base, read remainders from bottom to top. 2,623 to hex: 2623/16=163 r15(F), 163/16=10 r3, 10/16=0 r10(A). Result reading bottom to top: A3F. Hex-binary shortcut: each hex digit converts to exactly 4 binary bits. E=1110, 7=0111, F=1111. 0xE7F = 1110 0111 1111 in binary — no intermediate decimal step needed.
Tips & Best Practices
- ✓Hex-binary shortcut: memorise the 16 hex digit binary equivalents (0=0000 through F=1111) and convert without going through decimal.
- ✓Octal-binary shortcut: each octal digit converts to exactly 3 binary bits. 7=111, 5=101, 3=011.
- ✓Base 64 encoding: used for binary-to-text encoding in email (MIME), URLs, and data URIs. Each base-64 character represents 6 bits. Four base-64 characters encode three bytes.
- ✓Two's complement: how computers represent negative integers in binary. Flip all bits and add 1: -5 in 8-bit two's complement = NOT(0000 0101) + 1 = 1111 1010 + 1 = 1111 1011.
- ✓Floating point: decimal fractions in binary often cannot be represented exactly — 0.1 in binary is an infinitely repeating fraction 0.0001100110011... This causes the famous floating-point precision issues in programming.
- ✓Base 36: uses digits 0-9 and letters a-z. Used for URL shorteners and compact identifiers because it maximises information per character using only alphanumeric characters.
- ✓Balanced ternary (base 3): uses digits -1, 0, 1. Theoretically optimal for computing but impractical with modern silicon. The Soviet Setun computer used balanced ternary in the 1950s.
- ✓Base conversion in programming: printf("%x", n) in C prints n in hex; bin(n) in Python returns binary string; int("FF", 16) in Python converts hex string to decimal.
Who Uses This Calculator
Computer science students learning digital number systems and two's complement. Programmers working with hex color codes, memory addresses, and bitwise operations. Electronics engineers reading hardware registers in different bases. Students completing base conversion assignments. Security analysts examining binary file contents in hex editors. Embedded systems developers working with microcontroller configuration registers.
Optimised for: USA · Canada · UK · Australia · Calculations run in your browser · No data stored
Frequently Asked Questions
How do you convert decimal to hexadecimal?
Divide by 16 repeatedly, collect remainders. Decimal 255: 255÷16=15 R15 → FF in hex (F=15).