01
✓ Editorially reviewed by Derek Giordano, Founder & Editor · BA Business Marketing

Number Base Converter

Binary Octal Decimal Hex

Last reviewed: January 2026

🧮
500 calculators, no signup required
Finance · Health · Math · Science · Business
nnng.com

What Is a Number Base Converter?

A number base converter translates numbers between different numeral systems including binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). It is essential for programmers, electrical engineers, and computer science students.

How Number Base Systems Work

A number base determines how many unique digits are available before carrying to the next position. Decimal (base-10) uses digits 0-9, binary (base-2) uses 0-1, octal (base-8) uses 0-7, and hexadecimal (base-16) uses 0-9 plus A-F.[1] Converting from any base to decimal involves multiplying each digit by its positional value: in base-b, the rightmost digit has value b⁰ = 1, the next b¹ = b, then b², and so on. Converting from decimal to another base uses repeated division by the base, collecting remainders.[2] Binary is fundamental to computing (transistors have two states), octal was historically used in early Unix systems, and hexadecimal remains essential for memory addresses, color codes, and compact binary representation.[3] Use the Binary Calculator for binary arithmetic.

Number Base Comparison

DecimalBinary (2)Octal (8)Hex (16)
711177
10101012A
42101010522A
100110010014464
25511111111377FF

Understanding Number Systems

Every number system uses a positional notation where each digit's value depends on its position. In decimal (base-10), the rightmost digit represents ones (10⁰), the next represents tens (10¹), then hundreds (10²), and so on. Binary (base-2) follows the same principle with powers of 2: the rightmost bit is 2⁰ = 1, the next is 2¹ = 2, then 2² = 4, then 2³ = 8. The number 1101 in binary equals 1×8 + 1×4 + 0×2 + 1×1 = 13 in decimal. This positional system was a revolutionary advance over Roman numerals and other additive systems because it enables efficient arithmetic operations and scales to arbitrarily large numbers using a fixed set of symbols.

Computers use binary because transistors have two stable states: on (1) and off (0). Every operation a computer performs — from displaying text to streaming video — ultimately reduces to billions of binary operations per second. Hexadecimal (base-16) serves as a human-friendly shorthand for binary: each hex digit maps to exactly four binary digits (bits), so the byte 11010110 becomes D6 in hex. This is far easier for programmers to read and type than long binary strings. Octal (base-8), where each digit represents three bits, was historically common on systems with 12-bit, 24-bit, and 36-bit word sizes but has largely been replaced by hexadecimal in modern computing.

Practical Applications of Base Conversion

Web development uses hexadecimal constantly for color codes (#FF5733), memory addresses (0x7FFE3200), and character encoding (Unicode code points like U+1F600 for the grinning face emoji). Network engineers work with binary for subnet masks and IP address calculations — a subnet mask of 255.255.255.0 is 11111111.11111111.11111111.00000000 in binary, making the /24 notation (24 consecutive ones) immediately clear. Cryptographers analyze algorithms in binary to understand bit-level operations like XOR, bit shifting, and rotation that form the foundation of encryption standards like AES and SHA-256.

Digital electronics designers use hexadecimal to program microcontrollers and FPGAs, where register configurations are specified as hex values that map directly to individual control bits. A value of 0x3F written to an I/O port means binary 00111111 — six output pins turned on and two turned off. Understanding base conversion is not just academic; it is a daily working skill for software developers, network administrators, hardware engineers, and security professionals. File formats, communication protocols, and debugging tools all present data in hexadecimal, and being able to mentally convert between hex, binary, and decimal accelerates problem-solving across all computing disciplines.

Conversion Methods

Converting from any base to decimal uses the expansion method: multiply each digit by its positional value and sum. Converting from decimal to another base uses repeated division: divide the decimal number by the target base, record the remainder, and repeat with the quotient until it reaches zero — then read the remainders from bottom to top. For example, converting 156 to binary: 156÷2=78 r0, 78÷2=39 r0, 39÷2=19 r1, 19÷2=9 r1, 9÷2=4 r1, 4÷2=2 r0, 2÷2=1 r0, 1÷2=0 r1. Reading remainders bottom-to-top: 10011100. Converting between binary and hex uses the grouping shortcut: split binary digits into groups of four from the right and convert each group independently (1001 1100 = 9C in hex).

Fractional numbers in different bases follow the same positional principle but extend to the right of the radix point. In binary, 0.101 = 1×2⁻¹ + 0×2⁻² + 1×2⁻³ = 0.5 + 0 + 0.125 = 0.625 in decimal. An important consequence is that some fractions that terminate in one base do not terminate in another. The decimal fraction 0.1 has an infinitely repeating representation in binary (0.0001100110011...), which is why floating-point arithmetic in computers sometimes produces unexpected results like 0.1 + 0.2 = 0.30000000000000004 rather than exactly 0.3. This is not a bug but a fundamental property of binary representation of decimal fractions.

Binary Arithmetic Fundamentals

Binary addition follows four simple rules: 0+0=0, 0+1=1, 1+0=1, 1+1=10 (zero with a carry of one). Adding 1011 + 1101 in binary: starting from the right, 1+1=10 (write 0 carry 1), 1+0+1(carry)=10 (write 0 carry 1), 0+1+1(carry)=10 (write 0 carry 1), 1+1+1(carry)=11 (write 11). Result: 11000. Verifying: 1011=11, 1101=13, 11000=24. 11+13=24. This same addition process runs billions of times per second inside every processor — digital circuits called adders implement these exact rules using logic gates. Understanding binary arithmetic illuminates how computers perform all mathematical operations by combining simple binary addition with shifting and complementing operations.

Hexadecimal arithmetic is used when debugging memory contents, analyzing network packets, or working with embedded systems firmware. Each hex digit position represents a power of 16: A3F = 10×256 + 3×16 + 15×1 = 2623 in decimal. The hex digits A through F represent decimal values 10 through 15, extending the single-digit range beyond 0-9. This is why hexadecimal is sometimes called "base-16" — it requires 16 unique symbols. In assembly language programming and reverse engineering, virtually all addresses, opcodes, and data values are displayed in hexadecimal because it provides a compact representation that maps directly to the underlying binary while remaining human-readable.

Why do computers use binary?
Digital circuits have two stable states — on (1) and off (0) — making binary the natural language of electronics. Transistors switch between these states billions of times per second. Higher bases would require circuits to distinguish between more voltage levels, increasing error rates and complexity.
What is hexadecimal used for?
Hexadecimal (base 16) is a compact way to represent binary data — each hex digit maps to exactly 4 binary digits. The byte value 11111111 (binary) = FF (hex) instead of 255 (decimal). Programmers use hex for memory addresses, color codes (#FF0000 = red), MAC addresses, and debugging because it's more readable than long binary strings.

Number Bases in Computing

Binary (base-2) is the foundation of all digital computing — every value is stored as sequences of 0s and 1s representing electrical on/off states. Hexadecimal (base-16) condenses binary into a compact, human-readable format: each hex digit maps to exactly 4 binary digits (0xF = 1111, 0xFF = 11111111 = 255 in decimal). HTML colors, memory addresses, and MAC addresses use hex notation. Octal (base-8) was common in older Unix systems for file permissions (chmod 755 = rwxr-xr-x). Understanding base conversion is essential for programming, networking, and hardware debugging. A byte (8 bits) stores values 0–255 in decimal, 00–FF in hex, or 00000000–11111111 in binary. Explore binary arithmetic with our Binary Calculator and hex calculations with our Hex Calculator.

How do computers represent negative numbers in binary?
Most modern systems use two's complement notation: the most significant bit indicates the sign (0 = positive, 1 = negative), and negative values are formed by inverting all bits and adding 1. An 8-bit signed integer ranges from −128 to +127 (vs 0 to 255 unsigned). This system simplifies hardware design because addition and subtraction use the same circuit. The concept of overflow occurs when a calculation exceeds this range — adding 1 to +127 wraps to −128 in an 8-bit system. For a related calculation, try our Average Calculator.
How do I convert decimal to any base?
Repeatedly divide the decimal number by the target base and collect remainders from bottom to top. Example: 42 to binary: 42÷2=21 r0, 21÷2=10 r1, 10÷2=5 r0, 5÷2=2 r1, 2÷2=1 r0, 1÷2=0 r1. Read remainders bottom-up: 101010. For hex: 42÷16=2 r10(A). Read: 2A.
Why do computers use binary instead of decimal?
Electronic circuits reliably distinguish between two voltage states (high=1, low=0) but struggle with ten distinct levels needed for decimal. Binary is noise-resistant — even with voltage fluctuations, high and low states remain distinguishable. This fundamental reliability at the hardware level makes binary the natural choice, with higher bases (octal, hex) used as human-readable shorthand.

See also: Roman Numeral Converter · Decimal to Fraction Converter · Data Storage Converter

How to Use This Calculator

  1. Enter a number in any base — Type a value and select its base: binary (base 2), octal (base 8), decimal (base 10), or hexadecimal (base 16). The converter supports custom bases from 2 to 36.
  2. View simultaneous conversions — The calculator instantly shows the number in all four standard bases. Binary and hex are essential for computing; octal is used in Unix file permissions.
  3. Convert between any two custom bases — Select any base from 2 to 36 for input and output. Base 36 uses 0–9 and A–Z, allowing compact encoding of large numbers.
  4. Understand the positional value breakdown — The calculator shows how each digit contributes to the total value in the target base, making the conversion process transparent and educational.

Tips and Best Practices

Every hex digit = 4 binary bits, every octal digit = 3 binary bits. This is why hex and octal exist — they're compact ways to represent binary. 0xFF = 1111 1111 = 255 decimal. 0o777 = 111 111 111 = 511 decimal. Memorize the 16 hex-to-binary mappings (0=0000, 1=0001... F=1111) and you can mentally convert any hex to binary instantly.

Binary is how computers actually work — all other bases are human conveniences. Every piece of data in a computer is ultimately stored as binary (0s and 1s). Hexadecimal is simply a human-readable shorthand for binary — easier to read FF than 11111111. Decimal is natural for humans but awkward for hardware.

Unix file permissions use octal notation. chmod 755 means owner=rwx (7=111), group=r-x (5=101), others=r-x (5=101). Each octal digit maps to a 3-bit permission set. Understanding octal-to-binary conversion is essential for system administration. See our Hex Calculator for hex arithmetic.

IP addresses and MAC addresses are best understood in binary and hex. An IPv4 address like 192.168.1.0/24 means the first 24 binary bits are the network address. Subnet masks (255.255.255.0 = 11111111.11111111.11111111.00000000) define which bits are network vs host. Our Subnet Calculator handles these conversions.

See also: Hex Calculator · Binary Calculator · Subnet Calculator · Color Converter

📚 Sources & References
  1. [1] Khan Academy. Number Systems. KhanAcademy.org
  2. [2] IEEE. Computer Number Standards. IEEE.org
  3. [3] NIST. Digital Information. NIST.gov
  4. [4] MIT OCW. Computer Science. OCW.MIT.edu
Editorial Standards — Every calculator is built from peer-reviewed formulas and official data sources, editorially reviewed for accuracy, and updated regularly. Read our full methodology · About the author