All the Tools You Need

Number Base Conversion Calculator - Binary, Decimal, Hex, Octal | Toolivaa

Number Base Conversion Calculator

Base Conversion Calculator

Convert numbers between binary (base-2), octal (base-8), decimal (base-10), hexadecimal (base-16) and other bases. Step-by-step conversion process with bit visualization.

Decimal to Binary: Divide by 2, record remainders
Any Base
Binary ↔ Decimal
Hex ↔ Decimal
Octal ↔ Decimal
Binary ↔ Hex
Enter numbers in appropriate format: Binary (0-1), Octal (0-7), Decimal (0-9), Hexadecimal (0-9, A-F). Letters can be uppercase or lowercase.

Binary to Decimal

1011₂
→ 11₁₀

Hex to Decimal

FF₁₆
→ 255₁₀

Octal to Decimal

377₈
→ 255₁₀

Conversion Result

Input (Base-10)
255
Output (Base-2)
11111111

Binary Bit Representation:

8-bit binary representation with bit positions and values

Place Value Breakdown:

Step-by-Step Conversion:

Power of Two Table:

Power2ⁿDecimalBinaryHex

Number Systems Comparison:

DecimalBinaryOctalHexadecimal

Number base conversion allows representation of values in different numeral systems.

What is Number Base Conversion?

Number base conversion is the process of changing a number from one base (radix) to another. The base determines how many digits are used in the number system and the value of each digit position. Common bases include binary (base-2), octal (base-8), decimal (base-10), and hexadecimal (base-16).

Common Number Bases

Binary (Base-2)

Digits: 0, 1

Computer systems

Digital logic

Octal (Base-8)

Digits: 0-7

Unix permissions

Legacy systems

Decimal (Base-10)

Digits: 0-9

Everyday use

Human counting

Hexadecimal (Base-16)

Digits: 0-9, A-F

Memory addresses

Color codes

Conversion Methods

1. Decimal to Any Base

Divide by base, record remainders:

Convert 255₁₀ to binary:
255 ÷ 2 = 127 remainder 1
127 ÷ 2 = 63 remainder 1
63 ÷ 2 = 31 remainder 1
31 ÷ 2 = 15 remainder 1
15 ÷ 2 = 7 remainder 1
7 ÷ 2 = 3 remainder 1
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Read remainders backward: 11111111₂

2. Any Base to Decimal

Multiply digits by base powers:

Convert 1011₂ to decimal:
1×2³ + 0×2² + 1×2¹ + 1×2⁰
= 1×8 + 0×4 + 1×2 + 1×1
= 8 + 0 + 2 + 1 = 11₁₀

3. Binary ⇔ Hexadecimal

Group binary digits (4 bits = 1 hex digit):

11111111₂ to hexadecimal:
Group: 1111 1111
1111₂ = F₁₆, 1111₂ = F₁₆
Result: FF₁₆

4. Binary ⇔ Octal

Group binary digits (3 bits = 1 octal digit):

11111111₂ to octal:
Group: 011 111 111
011₂ = 3₈, 111₂ = 7₈, 111₂ = 7₈
Result: 377₈

Real-World Applications

Computer Science & Programming

  • Memory addressing: Hexadecimal for memory locations
  • Bit manipulation: Binary for flags and bit fields
  • Color representation: Hex codes in HTML/CSS (e.g., #FF0000 = red)
  • Network protocols: IP addresses in decimal-dot notation

Digital Electronics

  • Logic gates: Binary operations (AND, OR, XOR)
  • Microcontrollers: Register manipulation in hex/binary
  • Signal processing: Binary data streams
  • FPGA programming: Configuration in hex format

Mathematics & Cryptography

  • Number theory: Studying properties of different bases
  • Error detection: Parity bits and checksums
  • Encryption: Binary operations in cryptographic algorithms
  • Data compression: Efficient number representation

Everyday Computing

  • File permissions: Unix octal permissions (chmod 755)
  • Character encoding: ASCII/Unicode values in hex
  • Debugging: Memory dumps in hex format
  • Web development: Color codes, URL encoding

Common Conversion Table

DecimalBinaryOctalHexadecimalBase-4
00000
11111
210222
311333
41004410
51015511
61106612
71117713
8100010820
9100111921
10101012A22
15111117F33
16100002010100
25511111111377FF3333

Step-by-Step Conversion Examples

Example 1: Decimal 255 to Binary

  1. Start with 255 (decimal)
  2. Divide by 2: 255 ÷ 2 = 127 remainder 1
  3. Divide 127 by 2: 127 ÷ 2 = 63 remainder 1
  4. Divide 63 by 2: 63 ÷ 2 = 31 remainder 1
  5. Divide 31 by 2: 31 ÷ 2 = 15 remainder 1
  6. Divide 15 by 2: 15 ÷ 2 = 7 remainder 1
  7. Divide 7 by 2: 7 ÷ 2 = 3 remainder 1
  8. Divide 3 by 2: 3 ÷ 2 = 1 remainder 1
  9. Divide 1 by 2: 1 ÷ 2 = 0 remainder 1
  10. Read remainders from bottom to top: 11111111
  11. Result: 255₁₀ = 11111111₂

Example 2: Binary 101101 to Decimal

  1. Binary number: 1 0 1 1 0 1
  2. Assign powers: 2⁵ 2⁴ 2³ 2² 2¹ 2⁰
  3. Multiply: 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1
  4. Calculate: 32 + 0 + 8 + 4 + 0 + 1 = 45
  5. Result: 101101₂ = 45₁₀

Example 3: Hex 1A3F to Binary

  1. Hex digits: 1 A 3 F
  2. Convert each hex digit to 4-bit binary:
    • 1₁₆ = 0001₂
    • A₁₆ = 1010₂
    • 3₁₆ = 0011₂
    • F₁₆ = 1111₂
  3. Combine: 0001 1010 0011 1111
  4. Remove leading zeros: 1101000111111
  5. Result: 1A3F₁₆ = 1101000111111₂

Special Number Representations

RepresentationDescriptionExampleUse Case
Two's ComplementNegative numbers in binary-5₁₀ = 11111011₂ (8-bit)Signed integer arithmetic
One's ComplementFlip all bits for negative-5₁₀ = 11111010₂ (8-bit)Historical systems
Sign-MagnitudeMSB = sign, rest = magnitude-5₁₀ = 10000101₂ (8-bit)Floating point sign bit
BCD (Binary Coded Decimal)Each decimal digit as 4 bits45₁₀ = 0100 0101Financial calculations
Gray CodeAdjacent values differ by 1 bit3₁₀ = 0010₂ (Gray)Rotary encoders

Related Calculators

Frequently Asked Questions (FAQs)

Q: Why do computers use binary instead of decimal?

A: Computers use binary because electronic components (transistors) have two stable states: on (1) and off (0). Binary is reliable, simple to implement electronically, and forms the foundation of digital logic gates.

Q: What's the advantage of hexadecimal over binary?

A: Hexadecimal is more compact than binary. One hex digit represents 4 binary digits (bits), making it easier for humans to read and write large binary values (e.g., memory addresses, color codes).

Q: How do I convert fractions between bases?

A: For fractional parts, multiply by the target base repeatedly. Example: Convert 0.625₁₀ to binary: 0.625×2=1.25 (1), 0.25×2=0.5 (0), 0.5×2=1.0 (1) → 0.101₂.

Q: What is two's complement and why is it important?

A: Two's complement is a method for representing signed integers in binary. It simplifies arithmetic operations (addition/subtraction work the same for signed and unsigned) and eliminates the "negative zero" problem found in other representations.

Convert numbers between any base with Toolivaa's free Number Base Conversion Calculator, and explore more computational tools in our Math Calculators collection.

Scroll to Top