Free Online Number Base Converter

πŸ”’ Runs in your browser β€” nothing is sent to a server

A universal number base converter for binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). Type a value on either side, pick the bases, and the result updates instantly. Useful for programming, digital electronics, Unix file permissions, color codes and debugging memory addresses. Long values up to arbitrary precision are handled with BigInt, so 64-bit integers round-trip exactly. Everything runs in your browser β€” no input ever leaves the page.

Allowed: 0–9

Allowed: 0–9, a–f

Supported bases: Binary (2), Octal (8), Decimal (10), Hexadecimal (16). Negative integers are accepted; fractional values are not.

Binary, Octal, Decimal, Hexadecimal β€” reference

The same integer value rendered in all four numeral systems.

Binary (2)Octal (8)Decimal (10)Hexadecimal (16)
0000
1111
10222
101555
10001088
10101210a
11111715f
10000201610
100000403220
10000001006440
110010014410064
1000000020012880
11111111377255ff
100000000400256100
1000000000020001024400

Why programmers use hexadecimal

Hexadecimal is the natural shorthand for binary data because each hex digit maps to exactly four binary digits (one nibble). Two hex digits encode one byte, eight hex digits encode a 32-bit word, sixteen hex digits encode a 64-bit word. That tight mapping is why memory addresses, MAC addresses, MD5 and SHA hashes, byte sequences in hex dumps and HTML/CSS color codes such as #ff8800 are all written in hex. Converting #ff8800 from hex gives the decimal triplet (255, 136, 0), the RGB intensities of each channel.

Octal in Unix file permissions

Octal survives in modern computing largely because of Unix file permissions. Each chmod digit is a 3-bit permission mask: 4 = read, 2 = write, 1 = execute, summed per role (owner, group, others). chmod 755 means owner has 7 = rwx, while group and others have 5 = rx β€” the typical permission set for an executable. chmod 644 means owner rw, others r β€” typical for a regular file. Decoding a chmod number is easy once you read it as three octal digits, each a sum of 4-2-1 binary flags.

How the conversion works under the hood

Every value is parsed into a canonical integer (a JavaScript BigInt for arbitrary length, falling back to a fast path for small numbers) and then formatted back into the target base. Because the canonical form is exact, a round-trip such as binary β†’ decimal β†’ hex always produces the same number β€” even for values like 0xffffffffffffffff (the maximum unsigned 64-bit integer, 18,446,744,073,709,551,615 in decimal) that exceed JavaScript’s native Number range. Negative values keep a leading minus sign in every base; fractional values are not supported in this version.

Glossary

Binary (base 2)

The binary numeral system uses only two digits β€” 0 and 1 β€” and is the native number system of every digital computer. Each binary digit (bit) represents a power of 2: the rightmost bit is 2^0 = 1, then 2^1 = 2, 2^2 = 4, 2^3 = 8 and so on. Eight bits form one byte. Binary underlies every memory cell, register and network packet.

Octal (base 8)

The octal numeral system uses digits 0 through 7. It was popular in early computing because each octal digit maps cleanly to exactly three binary digits, which made it convenient for systems with 12-, 24- or 36-bit words. Today its most common surviving use is Unix file permissions: chmod 755 means owner-rwx, group-rx, others-rx, where each digit is a 3-bit permission mask.

Decimal (base 10)

The decimal numeral system is the everyday number system used by humans, with digits 0 through 9. Each digit position represents a power of 10 β€” units, tens, hundreds, thousands. It is sometimes called base-10 or denary. All four bases on this page convert through decimal as a canonical integer value, so a round-trip such as binary β†’ decimal β†’ hex always produces the exact same number.

Hexadecimal (base 16)

The hexadecimal numeral system uses sixteen digits: 0–9 and a–f, where a–f represent 10–15. Each hex digit maps to exactly four binary digits (one nibble), which makes hex the compact human-readable form of binary data. Memory addresses, MAC addresses, MD5/SHA hashes, RGB color codes such as #ff8800 and machine-code bytes are all conventionally written in hex.

Bit / Byte / Nibble

A bit is a single binary digit (0 or 1) and the smallest unit of digital information. Eight bits make one byte, the standard unit of storage and the size of a single ASCII character. A nibble is four bits β€” exactly one hexadecimal digit β€” which is why hex is the natural shorthand for binary data: two hex digits encode one byte, eight hex digits encode a 32-bit word, sixteen hex digits encode a 64-bit word.

Two's complement

Two's complement is the standard way computers represent signed integers in binary. To negate a value, invert every bit then add one. The most significant bit acts as the sign bit: 0 means non-negative, 1 means negative. An n-bit signed integer covers the range βˆ’2^(nβˆ’1) to 2^(nβˆ’1)βˆ’1. This converter uses a leading minus sign for negatives instead of a fixed-width two's-complement encoding, since the bit width is unknown.

Related tools