Number Base Converter

Convert numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Supports arbitrary precision integers, prefix formats (0b, 0o, 0x), negative numbers, and two's complement representation.

Decimal
Hex (Lowercase)
Hex (Uppercase)
Hex (Grouped)
Hex (0x Prefix)
Binary
Binary (Grouped)
Octal
Base64
Two's Complement
Two's Complement (Grouped)

More about Number Bases

Number Systems

A number base (or radix) determines how many unique digits are used to represent numbers. In base N, each digit position represents a power of N.

BaseNameDigitsCommon Use
2Binary0, 1Digital circuits, data storage, bitwise operations
8Octal0-7Unix file permissions, legacy systems
10Decimal0-9Everyday counting, human-readable numbers
16Hexadecimal0-9, A-FMemory addresses, color codes, byte values
Quick Conversion Reference
DecimalBinaryOctalHex
0000000
1000111
5010155
81000108
10101012A
15111117F
16100002010
25511111111377FF
Common Prefixes
  • 0b or 0B for binary (e.g., 0b1010 = 10)
  • 0o or 0O for octal (e.g., 0o17 = 15)
  • 0x or 0X for hexadecimal (e.g., 0xFF = 255)
Two's Complement

Two's complement is the standard representation for signed integers in computing. To negate a number: invert all bits, then add 1. In an 8-bit system, values range from -128 (10000000) to 127 (01111111). The most significant bit indicates the sign: 0 for positive, 1 for negative.

Hex in Practice
  • Colors: #FF5733 = RGB(255, 87, 51). Each pair of hex digits represents one byte (0-255).
  • Memory: Addresses like 0x7FFF5FBFF8A0 are written in hex because each hex digit maps to exactly 4 binary digits.
  • File permissions: chmod 755 uses octal. 7 = rwx, 5 = r-x.

Related Tools