calcolatore.online

Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal. Shows all representations and conversion steps.

Number Base Converter: Binary, Octal, Decimal, Hexadecimal

This tool converts numbers between the four most commonly used number bases in computer science and mathematics: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). It shows all representations simultaneously and the conversion steps.

The Most Common Number Bases

In daily life we use the decimal system (base 10), with digits 0-9. But in computing and electronics, other bases are used:

  • Binary (base 2): only 0 and 1. The native language of computers: each bit represents an on/off state. Eight bits form a byte, which can represent 256 different values.
  • Octal (base 8): digits 0-7. Historically used in Unix systems for file permissions (e.g. chmod 755).
  • Hexadecimal (base 16): digits 0-9 and letters A-F. Each digit corresponds to exactly 4 bits, making it a compact notation for binary. Widely used for web colors (#FF5733), memory addresses, and software debugging.

How Conversion Works

The general method involves two steps:

  1. From source base to decimal: multiply each digit by the base raised to the power of its position, starting from 0 on the right.
  2. From decimal to target base: repeatedly divide the decimal number by the base, noting the remainders. The remainders read in reverse give the result.

Practical Applications

Base conversion is fundamental for programmers, computer science students, and electronics enthusiasts. CSS colors use hexadecimal (#RRGGBB), IPv6 addresses are in hexadecimal, Unix permissions use octal, and understanding binary is essential for grasping how computers work at the hardware level.

Frequently Asked Questions

What are number bases?
A number base indicates how many different symbols are used to represent numbers. Base 10 (decimal) uses 10 digits (0-9), base 2 (binary) uses 2 digits (0 and 1), base 8 (octal) uses 8 digits (0-7), and base 16 (hexadecimal) uses 16 symbols (0-9 and A-F).
Why is binary important?
Binary (base 2) is the native language of computers: every bit is a 0 or 1, corresponding to a circuit being off or on. All digital data (text, images, video) is stored in binary. A byte consists of 8 bits and can represent values from 0 to 255.
What is hexadecimal used for?
Hexadecimal (base 16) is a compact representation of binary: each hex digit corresponds to exactly 4 bits. It is used everywhere in computing: CSS colors (#FF0000 = red), memory addresses, MAC addresses, Unicode codes, and much more.