Number Base Converter

Convert numbers between any base from 2 to 36

Conversion Result

Decimal

255

Base 2

11111111

Hexadecimal

FF

Digit Count by Base

Multi-Base Table

BaseValueDigits
Base 2111111118
Base 83773
Base 102553
Base 16FF2

Understanding Number Bases

What Is a Number Base?

A number base (or radix) is the number of unique digits used to represent numbers. Base-10 (decimal) uses digits 0-9. Base-2 (binary) uses 0-1. Base-16 (hexadecimal) uses 0-9 and A-F.

Common Number Bases

Binary (base-2) is fundamental in computing. Octal (base-8) is used in Unix file permissions. Decimal (base-10) is the everyday system. Hexadecimal (base-16) is used for memory addresses, colors, and data encoding.

How Conversion Works

To convert from any base to decimal, multiply each digit by its positional weight (base^position) and sum. To convert from decimal to any base, repeatedly divide by the target base and collect remainders.

Positional Notation

In base-b, the number dₙdₙ₋₁...d₁d₀ equals dₙ×bⁿ + dₙ₋₁×bⁿ⁻¹ + ... + d₁×b + d₀. For example, 1A hex = 1×16 + 10 = 26 decimal.

Applications

Binary is the language of computers. Hex simplifies binary representation (4 binary digits = 1 hex digit). Base-64 encodes binary data as text. Base-36 provides compact alphanumeric identifiers.

Practical Example

Convert 255 (decimal) to binary: 255 ÷ 2 = 127 R 1, 127 ÷ 2 = 63 R 1, 63 ÷ 2 = 31 R 1, 31 ÷ 2 = 15 R 1, 15 ÷ 2 = 7 R 1, 7 ÷ 2 = 3 R 1, 3 ÷ 2 = 1 R 1, 1 ÷ 2 = 0 R 1. Reading remainders bottom-up: 11111111.

255 in hex: 255 ÷ 16 = 15 R 15, 15 ÷ 16 = 0 R 15. So FF in hex.

Perguntas Frequentes

What is hexadecimal used for?

Hexadecimal is used for memory addresses, color codes (like #FF5733), MAC addresses, and representing binary data compactly. One hex digit represents exactly 4 binary digits.

Why do computers use binary?

Computers use binary because electronic circuits have two stable states: on (1) and off (0). Transistors naturally represent binary digits, making binary the most reliable hardware implementation.

What is the highest practical number base?

Base-36 is the highest practical base using 0-9 and A-Z. Beyond that, you need multi-character digit representations. Base-64 is common for encoding but uses special characters.

How do I convert binary to hex quickly?

Group binary digits in sets of 4 from right to left, then convert each group to its hex equivalent. Example: 11111111 → 1111 1111 → F F = FF.

What is two's complement?

Two's complement is a way to represent negative numbers in binary. To negate a number, invert all bits and add 1. The leftmost bit indicates sign: 0 = positive, 1 = negative.

Disclaimer: This converter handles integers. Verify critical conversions independently.

References

  1. Wikipedia. "Radix." en.wikipedia.org
  2. Khan Academy. "Binary and hexadecimal number systems." khanacademy.org

Comentários