Free Online Tool

Number Base Converter

Convert between Binary, Octal, Decimal, and Hexadecimal

No data is sent to any server — everything runs client-side

Type in any field — the others update in real-time. Supports large numbers via BigInt.

BinaryPrefix: 0bBase 2
OctalPrefix: 0oBase 8
DecimalBase 10
HexadecimalPrefix: 0xBase 16

Understanding Number Bases

A number base (or radix) defines how many unique digits are used to represent numbers. We use base-10 (decimal) in everyday life because we have 10 fingers. Computers use base-2 (binary) because transistors have two states (on/off). Hexadecimal (base-16) is a convenient shorthand for binary — each hex digit maps to exactly 4 binary digits.

Quick Reference

DecimalBinaryOctalHex
0000
1111
21022
410044
81000108
10101012A
15111117F
16100002010
321000004020
64100000010040
12711111111777F
1281000000020080
25511111111377FF
256100000000400100

When to Use

CSS Colors

Hex color codes (#FF5733) are base-16 RGB values. Convert to decimal to find the exact R/G/B values (255, 87, 51).

Bitwise Operations

Debug bit flags, permissions (chmod 755 = 111 101 101), and bitwise AND/OR/XOR operations by viewing values in binary.

Memory Addresses

Memory addresses and pointers are displayed in hex. Convert to decimal for offsets or binary for bit-level analysis.

Network & IP

Subnet masks (255.255.255.0 = 11111111.11111111.11111111.00000000), IPv6 addresses (hex), MAC addresses (hex).

Related Tools

Frequently Asked Questions

Why do computers use binary (base-2)?

Computers use binary because their fundamental storage and processing units — transistors and logic gates — have two stable states: on (1) and off (0). This maps naturally to binary digits. All more complex data types (integers, floats, text, images) are ultimately encoded as sequences of bits.

Why is hexadecimal used so often in programming?

Hexadecimal (base-16) is a compact shorthand for binary. Each hex digit represents exactly 4 binary digits (nibble), so a byte (8 bits) is always exactly 2 hex digits. This makes memory addresses, color codes (#FF5733), and bitmasks much more readable than their binary equivalents.

What is the largest number this converter can handle?

This tool uses JavaScript BigInt which supports arbitrarily large integers — there is no practical upper limit. It handles 64-bit values and beyond.

How do I convert a negative number?

This tool works with non-negative integers (unsigned). For negative numbers in two's complement representation (common in low-level programming), you would need to know the bit width and interpret accordingly. Enter the raw bit pattern and convert from binary.

What is octal (base-8) used for?

Octal is used primarily in Unix/Linux file permissions. chmod 755 means owner has rwx (111₂ = 7), group has r-x (101₂ = 5), others have r-x (101₂ = 5). Each octal digit represents exactly 3 binary bits.

Further Reading

Built by JDApplications