Number Base Converter

Convert numbers between decimal, binary, octal, hexadecimal, and text.

Why Use Our Number Base Converter?

  • 🔢 Convert instantly between decimal, binary, octal, hex, and text
  • ⚡ Fast and browser-friendly
  • 📱 Mobile & desktop friendly design
  • 📋 One-click copy to clipboard

Frequently Asked Questions

What is a Number Base Converter?

A Number Base Converter is a tool that allows you to convert numbers between different numeral systems such as decimal, binary, octal, hexadecimal, and even text.

How do I convert binary to decimal?

Simply enter your binary number prefixed with 0b (e.g., 0b1010) into the converter, and it will instantly show the equivalent decimal value.

Is this Number Base Converter free?

Yes, this tool is completely free and works instantly in your browser without any registration.

Understanding Number Systems

A number system, or numeral system, is a method of representing numbers using a consistent set of symbols and rules. The system we use in everyday life is the decimal (base-10) system, which employs ten digits from 0 to 9. Computers, however, operate on the binary (base-2) system, using only the digits 0 and 1. Two additional systems are widely used in computing: octal (base-8), which uses digits 0 through 7, and hexadecimal (base-16), which extends the digit set with the letters A through F to represent values 10 through 15. Each system serves a different purpose and provides a more convenient way to represent data depending on the context.

Numbers 0-15 in All Four Bases

The table below shows the first 16 values (0 through 15) in binary, octal, decimal, and hexadecimal. These are the building blocks for all larger numbers and are essential to memorize for anyone working with low-level computing.

DecimalBinaryOctalHexadecimal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Notice how each hexadecimal digit corresponds to exactly 4 binary bits, and each octal digit corresponds to exactly 3 binary bits.

How Positional Number Systems Work

All the number systems used in computing are positional, meaning the value of each digit depends on its position within the number. In any base-B system, the rightmost digit has a positional weight of B0 (which equals 1), the next digit to the left has weight B1, then B2, and so on. To find the decimal value, multiply each digit by its positional weight and add the results together.

Worked Example: Binary 1101 to Decimal

1101 in base 2:

(1 x 23) + (1 x 22) + (0 x 21) + (1 x 20)

= 8 + 4 + 0 + 1

= 13 in decimal

Worked Example: Hex 2F to Decimal

2F in base 16:

(2 x 161) + (F x 160)

= 32 + 15

= 47 in decimal

Worked Example: Decimal 47 to Binary (Repeated Division)

47 / 2 = 23 remainder 1

23 / 2 = 11 remainder 1

11 / 2 = 5 remainder 1

5 / 2 = 2 remainder 1

2 / 2 = 1 remainder 0

1 / 2 = 0 remainder 1

Read remainders bottom to top: 101111 in binary

How Base Conversion Works

Converting a number from one base to another involves two fundamental steps. First, the number is interpreted in its original base by multiplying each digit by the base raised to the power of its position, starting from zero on the right. For instance, the binary number 1010 equals 1x8 + 0x4 + 1x2 + 0x1 = 10 in decimal. Second, to express a decimal number in a target base, you repeatedly divide by the target base and collect the remainders in reverse order. Dividing 10 by 2 yields remainders 0, 1, 0, 1, which read backwards gives 1010. For hexadecimal, dividing 255 by 16 gives 15 remainder 15, producing FF. This process works for any base and is the algorithm that our converter uses internally.

Why Hexadecimal Is Used in Computing

Hexadecimal (base 16) is ubiquitous in computing because it provides a compact, human-readable representation of binary data. Since 16 is a power of 2 (24 = 16), each hex digit maps to exactly 4 binary bits. This means an 8-bit byte can always be expressed as exactly two hex digits, a 32-bit value as eight hex digits, and so on, with no wasted digits or ambiguity.

Color Codes

Web colors like #FF5733 encode red (FF=255), green (57=87), and blue (33=51) as hex pairs. Each pair represents one byte (0-255), making hex the natural choice for specifying 24-bit color values.

Memory Addresses

Memory addresses in debuggers, crash logs, and system programming are displayed in hex (e.g., 0x7FFF5FBFF8A0) because the hex representation is far shorter than binary while preserving direct bit-level correspondence.

MAC Addresses

Network hardware identifiers (e.g., 00:1A:2B:3C:4D:5E) are written as six pairs of hex digits separated by colons, each pair representing one byte of the 48-bit address.

Cryptographic Hashes

Hash values like SHA-256 produce 256 bits of output, which would be 256 characters in binary but only 64 characters in hex -- much easier to display, compare, and copy.

Octal in Unix File Permissions

Octal (base 8) has a special role in Unix and Linux systems for representing file permissions. Each file has three permission groups -- owner, group, and others -- and each group has three permission bits: read (r=4), write (w=2), and execute (x=1). Since three bits produce values 0 through 7, a single octal digit perfectly represents one permission group.

Octal ValueBinaryPermissionsMeaning
0000---No permissions
1001--xExecute only
4100r--Read only
5101r-xRead and execute
6110rw-Read and write
7111rwxRead, write, and execute

The command chmod 755 translates to: owner gets rwx (7), group gets r-x (5), and others get r-x (5). Similarly, chmod 644 means owner gets rw- (6), while group and others get r-- (4). This compact octal notation is far easier to read and type than the equivalent binary representation of nine individual permission bits.

Binary, Octal, Decimal, and Hexadecimal in Computing

Each number base plays a specific role in software development and computer engineering. Binary is the native language of hardware: processor instructions, memory addresses, and data storage all operate in binary. Octal was historically popular in systems with word sizes that were multiples of three bits. It is still used in Unix file permissions, where chmod 755 grants read, write, and execute permissions using octal notation. Decimal is used for user-facing values, financial calculations, and any context where human readability is paramount. Hexadecimal is the preferred shorthand for binary data because each hex digit maps cleanly to exactly four binary bits, making it far more compact. A single byte (8 bits) is represented by exactly two hex digits, which is why memory addresses, color codes like #FF5733, MAC addresses, and cryptographic hashes are almost always displayed in hexadecimal. Understanding how to move between these bases is an essential skill for programmers, network engineers, and anyone working close to the hardware level.

Common Powers of 2 Reference

Powers of 2 appear constantly in computing -- memory sizes, buffer lengths, hash outputs, and bit widths are all powers of 2. Memorizing the common ones helps you work fluently with binary and hexadecimal values.

PowerDecimalHexCommon Name
282560x1001 byte range
2101,0240x4001 KB
21665,5360x100002 byte range
2201,048,5760x1000001 MB
2301,073,741,8240x400000001 GB
2324,294,967,2960x1000000004 byte range

Quick Conversion Shortcuts

Experienced developers use mental shortcuts to convert between bases without going through the full division algorithm every time.

  • Binary to Hex: Group binary digits into sets of four from the right, then convert each group to its hex digit. For example, 1010 1111 becomes AF (1010=A, 1111=F).
  • Hex to Binary: Replace each hex digit with its 4-bit binary equivalent. 3C becomes 0011 1100.
  • Binary to Octal: Group binary digits into sets of three from the right. 101 111 becomes 57 in octal.
  • Doubling for binary: Each position to the left doubles (1, 2, 4, 8, 16, 32, 64, 128). Mentally add the "on" positions to get decimal. For 11001: 16+8+1 = 25.

Frequently Asked Questions

Related Calculators