Skip to content

Number Base Converter

Convert between binary, decimal, hexadecimal, and octal number systems online. Free number base converter for programmers and students.

Calculators
Instant results
0b
0o
0x

Quick Examples

About Number Base Conversion

Binary (Base 2): Uses only 0 and 1. Used in computing.

Octal (Base 8): Uses digits 0-7. Used in Unix file permissions.

Decimal (Base 10): Standard number system using 0-9.

Hexadecimal (Base 16): Uses 0-9 and A-F. Used in colors, memory addresses.

How to Use Number Base Converter

1

Enter a number

Type the number you want to convert. Specify the source base (binary, octal, decimal, hex, or custom).

2

View all bases

See the number in binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) simultaneously.

3

Use for context

Programming: hex for memory/colors, binary for bit manipulation. Networking: hex for MAC/IP addresses. Math: any base for pure curiosity.

4

Verify with examples

Common reference points: 255 = 0xFF = 11111111. 256 = 0x100 = 100000000. Use these to verify the converter is working correctly.

When to Use Number Base Converter

Programming and bit manipulation

Convert between binary (for bit operations), hex (for memory addresses, color codes, byte representation), and decimal (human readable). Essential for low-level programming, embedded systems, and understanding bitmask operations.

Networking: IP and MAC addresses

IPv4 octets in decimal (192.168.1.1) and binary (used in subnet calculations). MAC addresses in hex (00:1A:2B:3C:4D:5E). Converting between bases helps understand subnetting, network protocols, and binary calculations like CIDR notation.

Web development: hex colors and timestamps

Hex colors (#FF5733) in CSS. Sometimes you need RGB decimals — the converter handles. Unix timestamps (decimal seconds since 1970) sometimes appear in hex. Number base conversion bridges these representations.

Cryptography and security

Hash outputs (SHA-256) in hex. Public keys often shown in hex or base64. Understanding base conversions helps when working with crypto outputs, debugging key formats, or reverse-engineering encrypted protocols.

Number Base Converter Examples

Common conversions

Input
Decimal: 255
Output
Binary: 11111111 (8 bits)\nOctal: 377\nHexadecimal: FF

255 = max value of 1 byte. Binary 11111111 = all 8 bits set. Hex FF (two hex digits = one byte). Common reference point in computing — the boundary of unsigned 8-bit numbers.

Hex to decimal

Input
Hex: 0x4A
Output
Decimal: 74\nBinary: 01001010

Hex 4A = (4 × 16) + 10 = 74 decimal. The 'A' in hex = 10 in decimal. Each hex digit represents 4 binary bits, making hex compact for byte representation.

Color conversion

Input
Color: #FF5733
Output
R=255 (FF), G=87 (57), B=51 (33)

Each pair of hex digits = one color component. FF = 255 (max red), 57 = 87 (medium green), 33 = 51 (low blue). Standard RGB color encoding used in CSS, design tools, image formats.

Tips & Best Practices for Number Base Converter

  • 1.Hex is more readable than long binary. 11111111 (8 bits) is clearer as FF (2 hex digits). Each hex digit = 4 bits exactly.
  • 2.Common power-of-2 values: 256 = 2^8 (one byte's range), 1024 = 2^10 (kilobyte boundary), 65536 = 2^16 (max unsigned 16-bit). Knowing these helps quick mental conversions.
  • 3.Binary's pattern: 1, 2, 4, 8, 16, 32, 64, 128, 256... each bit position is double the previous. This 'powers of 2' relationship underpins all base 2 math.
  • 4.Programming languages have hex literal prefixes: 0x in C/JavaScript/Python. Binary literals: 0b in Python/JavaScript ES6+. Use these for clarity over hard-coded decimal.
  • 5.For numerical limits, hex is more readable: 0xFF (255), 0xFFFF (65535), 0xFFFFFFFF (~4 billion). Easier to read than long decimals.
  • 6.Don't confuse hex 0x10 (=16) with decimal 10. Always indicate the base or use a converter when ambiguous.

Frequently Asked Questions

A base (or radix) is the number of distinct digits a numeral system uses. Common bases: binary (base 2, digits 0-1), octal (base 8, digits 0-7), decimal (base 10, digits 0-9), hexadecimal (base 16, digits 0-9 and A-F). The same number can be represented in any base; this converter translates between them.