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.

Zahlensysteme und Informatik

Binärsystem (Basis 2): Grundlage der digitalen Technik. Jedes Bit hat den Wert 0 oder 1. Ein Byte = 8 Bits = 256 mögliche Werte (0-255). Umrechnung Dezimal zu Binär: wiederholte Division durch 2, Reste von unten nach oben lesen. Beispiel: 42 = 101010₂. Hexadezimalsystem (Basis 16): 0-9, A=10, B=11, C=12, D=13, E=14, F=15. Eine Hex-Ziffer = 4 Bits. Beispiel: FF₁₆ = 255₁₀. Anwendungen: Farben in CSS (#FF5733), Speicheradressen (0x7FFF), Unicode (U+0041 = „A"). Oktalsystem (Basis 8): historisch wichtig (Unix-Dateirechte: 755 = rwxr-xr-x). Base64: Kodierung für E-Mail-Anhänge, Daten-URLs, JWT-Tokens. Jede 3 Bytes werden als 4 Base64-Zeichen dargestellt.

Positionsnotation und Stellenwertsysteme

Im Dezimalsystem hat jede Stelle den Wert Ziffer × 10^Position. Beispiel: 3.847 = 3×10³ + 8×10² + 4×10¹ + 7×10⁰ = 3.000 + 800 + 40 + 7. Allgemein: im System zur Basis b hat die Ziffer z an Position p den Wert z×b^p. Umrechnungsregeln: Basis b → Dezimal: zₙ×bⁿ + zₙ₋₁×bⁿ⁻¹ + ... + z₁×b¹ + z₀×b⁰. Dezimal → Basis b: wiederholte Division durch b, Reste notieren. Spezialfälle: 10 (Dezimal), 2 (Binär), 8 (Oktal), 16 (Hexadezimal), 60 (Sexagesimal: Zeit, Winkel), 64 (Base64). Kommas in anderen Basen: 0,1₂ = 0,5₁₀, 0,A₁₆ = 0,625₁₀.

Ungewöhnliche Zahlensysteme

Balanciertes Ternärsystem (Basis 3, Ziffern -1, 0, +1): verwendet in der Sowjetunion für den Setun-Computer (1958). Keine Vorzeichenbit nötig, natürliche Rundung. Negabinärsystem (Basis -2): erlaubt Darstellung negativer Zahlen ohne Vorzeichen. Goldener Schnitt Phinary (Basis φ): Ziffern 0 und 1, keine aufeinanderfolgenden 1en. Bi-quinary (Basis 2+5): verwendet im römischen Abakus und japanischen Soroban. Gemischt-radix: Zeit (60 Sekunden, 60 Minuten, 24 Stunden, 7 Tage), englische Maße (12 Zoll/Fuß, 3 Fuß/Yard, 1760 Yard/Meile). Die Vielfalt zeigt, dass das Dezimalsystem nicht natürlich sondern historisch bedingt ist — es dominiert wegen unserer 10 Finger.

Konvertierung zwischen Zahlensystemen

Methoden: Dezimal → Binär: Division durch 2 mit Rest. 42₁₀ = 101010₂ (42÷2=21R0, 21÷2=10R1, 10÷2=5R0, 5÷2=2R1, 2÷2=1R0, 1÷2=0R1). Binär → Hex: 4 Bits gruppieren. 10101010₂ = AA₁₆. Hex → RGB: #FF0000 = (255, 0, 0) = Rot. Schnelle Konvertierungstabelle: 0-9, A=10, B=11, C=12, D=13, E=14, F=15. Praxis-Tipp: 2^10 = 1024 ≈ 1K, 2^20 = 1M, 2^30 = 1G, 2^40 = 1T. Speichergrößen: 1 Byte = 8 Bits, 1 KiB = 1024 Bytes, 1 MiB = 1024 KiB. Irritierend: Festplattenhersteller verwenden 1 KB = 1000 Bytes (dezimal), Betriebssysteme 1 KB = 1024 Bytes (binär) — deshalb zeigt eine 500GB Festplatte nur 465 GiB an.

Zahlensysteme im Alltag

Dezimal (Basis 10): Standard, 10 Finger. Zeit (Basis 60): 60 Sekunden/Minute, 60 Minuten/Stunde — vom babylonischen Sexagesimalsystem. Datum (gemischt): 12 Monate, ~30 Tage, 7 Tage/Woche. Englische Maße: 12 Zoll/Fuß, 3 Fuß/Yard, 1760 Yard/Meile. Währung: historisch 12 Pfling/Schilling (UK bis 1971). Computer: Binär intern, Hex für Menschenlesbarkeit. Winkel: Grad (360), Bogenmaß (2π), Neugrad (400). Musik: 12 Halbtöne/Oktave. Die Koexistenz verschiedener Basen zeigt, dass kein System universell optimal ist.

Binärarithmetik

Grundoperationen im Binärsystem: Addition (0+0=0, 0+1=1, 1+0=1, 1+1=10 mit Übertrag). Beispiel: 1010 + 0011 = 1101. Subtraktion: Zweierkomplement (invertieren + 1 addieren). Beispiel: 1010 - 0011 = 1010 + 1101 = 0111. Multiplikation: wie schriftliche Multiplikation, aber einfacher (nur ×0 und ×1). 101 × 11 = 1111. Division: wie schriftliche Division. Bitweise Operationen: AND (&), OR (|), XOR (^), NOT (~), Links-Shift (<<), Rechts-Shift (>>). Anwendung: Verschlüsselung (XOR), Flags (AND/OR), Grafik (Bit-Blitting), Kompression (Huffman-Codierung). Hexadezimal-Rechnung: FF + 01 = 100 (Übertrag), FF × 02 = 1FE. Das Verständnis der Binärarithmetik ist die Grundlage der Digitaltechnik und Informatik.

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.

Häufig gestellte Fragen

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

Kommentare