Number Base Converter - Multi-Radix Tool

Convert numbers between binary, octal, decimal, and hexadecimal instantly - with live results, prefix toggling, and one-click copy.

From Base

Examples:

Display Options

Show base prefixes ( 0x , 0o , 0b )

Conversion Results

BIN1101 1110 1010 1101 1011 1110 1110 1111
base 2
OCT33653337357
base 8
DEC3735928559
base 10
HEXDEADBEEF
base 16source

All conversions run locally in your browser - no data is sent to any server.

Number Base Converter: Binary, Octal, Decimal, and Hexadecimal Instantly

Number base conversion is a fundamental operation in computer science, electronics, and programming. Whether you are debugging memory addresses, reading color codes, understanding CPU registers, or working with Unix file permissions, our multi-radix converter handles all four common bases simultaneously.

Select your source base, type your number, and see all four representations update in real time. Toggle base prefixes (0x, 0o, 0b) for programming context, and copy individual results or all at once.

Formula
Decimal = sum(digit[i] * base^i) for i from 0 to n-1 Binary (base 2): digits 0,1 Octal (base 8): digits 0-7 Decimal (base 10): digits 0-9 Hex (base 16): digits 0-9, A-F

Each number system uses positional notation with a different base:

Binary and Hexadecimal Relationship

Binary and hexadecimal have a special relationship: each hex digit corresponds to exactly 4 binary bits (a nibble). This makes conversion trivial:

0 = 0000, 1 = 0001, 2 = 0010, 3 = 0011
4 = 0100, 5 = 0101, 6 = 0110, 7 = 0111
8 = 1000, 9 = 1001, A = 1010, B = 1011
C = 1100, D = 1101, E = 1110, F = 1111

So FF in hex = 11111111 in binary (two groups of 4 bits).

Common Use Cases

CSS/HTML colors: #FF6B6B = rgb(255, 107, 107)
Memory addresses: 0xDEADBEEF is a famous 32-bit debug magic value
File permissions: chmod 755 in octal = rwxr-xr-x
Network: MAC addresses in hex (00:1A:2B:3C:4D:5E)
Bitmasking: Using hex to define bitmasks in code

Practical Examples

Convert hex color to RGB

  • 1.Input: FF6B6B (hex)
  • 2.DEC: 16,737,130
  • 3.Split bytes: FF=255, 6B=107, 6B=107 → rgb(255, 107, 107)

Unix file permissions

  • 1.Input: 755 (octal)
  • 2.BIN: 111 101 101
  • 3.Meaning: rwx r-x r-x (owner/group/others)

Frequently Asked Questions

How do I convert hexadecimal to binary?

Each hex digit maps to exactly 4 binary digits: 0=0000, 1=0001, ..., F=1111. For example, FF = 11111111, DEADBEEF = 11011110101011011011111011101111. Our tool handles any hex number instantly.

How do I convert binary to decimal?

Multiply each bit by 2 raised to its position (from right, starting at 0), then sum all results. For example, 1010 = (1x8) + (0x4) + (1x2) + (0x1) = 10. The tool computes this with JavaScript's built-in parseInt(value, 2).

What is base 16 (hexadecimal)?

Hexadecimal uses 16 symbols: 0-9 for values 0-9, and A-F for values 10-15. It is widely used in programming for memory addresses, color codes (#FFFFFF), byte values (0xFF), and CPU registers because each hex digit represents exactly 4 binary bits.

What is the 0x prefix in hexadecimal?

The 0x prefix is a programming convention indicating a hexadecimal number. 0xFF means 255 in decimal. Similarly, 0b is used for binary (0b1010 = 10) and 0o for octal (0o17 = 15). You can toggle these prefixes in the Display Options.

Why is hexadecimal used in CSS colors?

CSS colors like #DEADBE use hexadecimal because each color channel (Red, Green, Blue) fits in exactly one byte (0-255), which is two hex digits (00-FF). This makes color values compact and directly mappable to hardware memory.

What is octal (base 8) used for?

Octal is used in Unix file permissions (chmod 755 = rwxr-xr-x), some older programming systems, and certain network protocols. Each octal digit represents exactly 3 binary bits, making it compact for binary-oriented data.

What is the maximum number this tool can convert?

JavaScript's integer precision limit is 2^53 - 1 (Number.MAX_SAFE_INTEGER = 9007199254740991 in decimal). For larger numbers, the tool may lose precision. For cryptographic or very large numbers, use a dedicated BigInt library.

Is this tool safe for sensitive data?

Yes. All conversion logic runs entirely in your browser using JavaScript's built-in parseInt() and toString() methods. No input is transmitted to any server.