Number Base Converter

Number Base Converter

Convert numbers between binary, octal, decimal, hexadecimal, and any base from 2 to 36

Binary (2)
Octal (8)
Decimal (10)
Hexadecimal (16)
Base

What are Number Bases?

A number base (also called radix) defines how many unique digits a numeral system uses to represent numbers. The base determines the place value of each digit position. For example, in base 10 (decimal), each position is worth 10 times the position to its right: ones, tens, hundreds, thousands, and so on. In base 2 (binary), each position doubles: 1, 2, 4, 8, 16, etc.

Humans naturally use base 10 because we have ten fingers, but computers operate in base 2 (binary) because transistors have two states — on and off. Bases 8 (octal) and 16 (hexadecimal) are popular shorthand notations because they map cleanly to groups of binary digits.

Base System Explanation

Every positional number system works the same way: each digit is multiplied by the base raised to the power of its position (starting from 0 on the right). The number is the sum of all these products.

Example: 2F3 in hexadecimal (base 16)

2 × 16² + F(15) × 16¹ + 3 × 16&sup0;

= 2 × 256 + 15 × 16 + 3 × 1

= 512 + 240 + 3 = 755 (decimal)

Binary, Octal, Decimal & Hexadecimal Comparison

DecimalBinaryOctalHex
0000000
1000111
2001022
7011177
81000108
10101012A
15111117F
16100002010
100110010014464
25511111111377FF

Common Use Cases

Programming

Binary and hexadecimal are fundamental in programming. Bitmasks, flags, memory addresses, and bitwise operations all use base-2 or base-16 representations.

Networking

IPv4 addresses use decimal octets (0-255), IPv6 uses hexadecimal notation, and subnet masks are often expressed in binary to visualize network/host bits.

Colors (CSS/HTML)

Web colors use hexadecimal notation: #FF5733 represents Red=255, Green=87, Blue=51 in RGB. Each pair is a base-16 number from 00 to FF.

File Permissions (Unix)

Unix file permissions use octal: chmod 755 means rwxr-xr-x. Each octal digit maps to a 3-bit binary pattern for read, write, and execute.

Assembly & Low-Level

Machine code and assembly language represent instructions and addresses in hexadecimal for readability, since each hex digit maps to exactly 4 binary bits.

Data Encoding

Base32 and Base36 encodings are used for compact URL-safe identifiers, serial numbers, and short codes where case-insensitivity is required.

Frequently Asked Questions

A number base or radix is the number of unique digits used in a positional numeral system. Base 10 uses digits 0-9, base 2 uses 0-1, base 16 uses 0-9 and A-F. The base determines how digit positions scale — each position is worth base^position times the digit value.

Computers use binary because digital circuits have two stable states: on (1) and off (0). This maps perfectly to base 2. All data — numbers, text, images, video — is ultimately represented as sequences of binary digits (bits) inside the hardware.

Hexadecimal is compact and maps perfectly to binary: each hex digit represents exactly 4 bits. This makes it easy to read memory addresses, color codes, byte values, and binary data. For example, the byte 11111111 in binary is simply FF in hex.

To convert from any base to decimal, multiply each digit by the base raised to its position power and sum the results. To convert from decimal to another base, repeatedly divide by the target base and collect the remainders in reverse order.

This tool supports all integer bases from 2 to 36. Bases above 10 use letters as additional digits: A=10, B=11, ... Z=35. The four most common bases (binary, octal, decimal, hexadecimal) are always shown, plus you can set any custom output base.

Yes. All conversions are performed entirely in your browser using JavaScript’s built-in parseInt() and toString() methods. No data is sent to any server — everything runs 100% client-side.

This tool uses JavaScript’s standard number type, which can safely represent integers up to 2^53 - 1 (9,007,199,254,740,991). Numbers larger than this may lose precision. For most practical use cases including 32-bit and 48-bit values, this is more than sufficient.