Number Base Converter

Convert numbers between binary, decimal, hexadecimal, and octal bases. Essential for programming, computer science, and digital electronics.

Convert Between Number Bases

Enter a number in any base and instantly see conversions to all other bases.

Binary (Base 2)

01
11111111
Bits: 8

Octal (Base 8)

0-7
377
Digits: 3

Decimal (Base 10)

0-9
255
Digits: 3

Hexadecimal (Base 16)

0-F
FF
Digits: 2

Binary Bit Visualization

Total Bits: 8
Ones (1): 8
Zeros (0): 0

Quick Conversions

Base Operations

โž•

Addition

Add numbers in any base with automatic conversion

โž–

Subtraction

Subtract numbers in any base

โœ–๏ธ

Multiplication

Multiply numbers in any base

โž—

Division

Divide numbers in any base

Number Base Tips

  • ๐Ÿ”ข

    Binary

    Base 2: uses only 0 and 1. Each digit represents a power of 2.

  • ๐Ÿ›‘

    Octal

    Base 8: uses digits 0-7. Groups of 3 binary digits.

  • ๐Ÿ’ฏ

    Decimal

    Base 10: our everyday number system using digits 0-9.

  • ๐Ÿ”Ÿ

    Hexadecimal

    Base 16: uses 0-9 and A-F. Groups of 4 binary digits.

Common Values

255 FF 11111111
128 80 10000000
64 40 1000000
32 20 100000
16 10 10000

Understanding Number Bases: A Complete Guide

Number bases, also called radices, are fundamental to mathematics and computer science. Different bases are used for different purposes, from everyday decimal calculations to computer binary operations.

What is a Number Base?

A number base indicates how many digits are available in a number system and how positional notation works. In base-b, numbers are represented using digits from 0 to b-1.

Positional Notation Formula:

Number = dโ‚™ ร— bโฟ + dโ‚™โ‚‹โ‚ ร— bโฟโปยน + ... + dโ‚ ร— bยน + dโ‚€ ร— bโฐ

Where d are digits and b is the base.

Common Number Bases Explained

Base Digits Uses Example
Binary (Base 2) 0, 1 Computer hardware, digital electronics 1011โ‚‚ = 11โ‚โ‚€
Octal (Base 8) 0-7 Unix permissions, older systems 755โ‚ˆ = 493โ‚โ‚€
Decimal (Base 10) 0-9 Everyday mathematics, commerce 255โ‚โ‚€
Hexadecimal (Base 16) 0-9, A-F Programming, memory addresses, color codes FFโ‚โ‚† = 255โ‚โ‚€

Conversion Methods

Decimal to Binary

  1. Divide the number by 2
  2. Record the remainder (0 or 1)
  3. Use the quotient as new number
  4. Repeat until quotient is 0
  5. Read remainders in reverse order

Example: 13โ‚โ‚€ = 1101โ‚‚

Binary to Hexadecimal

  1. Group binary digits in sets of 4 (add leading zeros if needed)
  2. Convert each group to its hex equivalent
  3. Concatenate the results

Example: 1101 0110โ‚‚ = D6โ‚โ‚†

Hexadecimal to Decimal

  1. Convert each hex digit to its decimal value (A=10, B=11, etc.)
  2. Multiply each digit by 16โฟ where n is its position from right (starting at 0)
  3. Sum all results

Example: 1Fโ‚โ‚† = 1ร—16 + 15 = 31โ‚โ‚€

Practical Applications

๐Ÿ’ป Programming

Hex used for memory addresses, binary for bitwise operations, decimal for general calculations.

๐ŸŽจ Web Design

Colors in HTML/CSS: #RRGGBB where RR, GG, BB are hex values (00-FF).

๐Ÿ”ง Computer Science

Binary for logic gates, hex for assembly language, octal for Unix permissions.

๐Ÿ“Š Data Storage

Bits and bytes calculations: 1 byte = 8 bits = 2 hex digits.

Frequently Asked Questions

Why do computers use binary?
Binary (base-2) corresponds directly to electronic circuits being ON (1) or OFF (0). It's the simplest system to implement in hardware.
Why is hexadecimal used in programming?
Hex is compact (1 hex digit = 4 binary digits), easy to convert to/from binary, and human-readable compared to long binary strings.