PureDevTools

Number Base Converter

Convert between binary, octal, decimal, hex, and any base 2–36 — instantly in your browser, nothing sent to any server

All processing happens in your browser. No data is sent to any server.

Input

Binary (2)
Octal (8)
Decimal (10)input
Hexadecimal (16)
Base reference chart ▸
DecimalBinaryOctalHex
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

What Is a Number Base Converter?

A number base converter — also called a radix converter or numeral system converter — translates a number written in one base (radix) into an equivalent representation in another base. Every base uses a fixed set of symbols (digits) to represent values, and the position of each digit determines its weight as a power of the base.

This tool converts instantly between the four most common numeral systems used in computing:

You can also convert to and from any custom base between 2 and 36, using digits 09 and letters AZ.

Why Do Computers Use Binary?

Digital computers are built from transistors that operate in two states: on (1) and off (0). This makes binary the natural language of hardware. Every piece of data a computer processes — text, images, audio, instructions — is ultimately stored and transmitted as sequences of 0s and 1s (bits).

Working directly in binary is tedious for humans because numbers grow long quickly. The decimal number 255 requires 8 binary digits (11111111). This is where hexadecimal becomes invaluable.

Binary and Hexadecimal: A Natural Pair

Each hex digit corresponds exactly to 4 binary bits (a nibble):

DecimalBinaryHex
000000
100011
401004
810008
101010A
151111F

This means you can convert binary to hex (and vice versa) by grouping bits into sets of 4:

Binary:  1010 1111 0011 1100
Hex:        A    F    3    C

And back:

Hex:     0x2B4F
Binary:  0010 1011 0100 1111

This grouping makes hex ideal for reading memory addresses, color codes, bitmasks, and byte values.

How to Convert Binary to Decimal

To convert a binary number to decimal, multiply each bit by its positional power of 2 and sum the results. The rightmost bit has position 0.

Example: Convert 1011 (binary) to decimal

BitPositionPowerValue
132³=88
022²=40
112¹=22
102⁰=11

8 + 0 + 2 + 1 = 11 (decimal)

The “Show conversion steps” section in this tool walks through this calculation automatically for any number you enter.

How to Convert Decimal to Binary

The standard method is repeated division by 2:

  1. Divide the number by 2 — record the remainder
  2. Divide the quotient by 2 — record the remainder
  3. Repeat until the quotient is 0
  4. Read the remainders from bottom to top

Example: Convert 42 (decimal) to binary

DivisionQuotientRemainder
42 ÷ 2210
21 ÷ 2101
10 ÷ 250
5 ÷ 221
2 ÷ 210
1 ÷ 201

Reading from bottom to top: 101010 — so 42 (decimal) = 101010 (binary).

How to Convert Decimal to Hexadecimal

Use the same repeated-division method, but divide by 16 instead of 2. Remainders 10–15 are represented as A–F.

Example: Convert 255 (decimal) to hex

DivisionQuotientRemainderDigit
255 ÷ 161515F
15 ÷ 16015F

Reading from bottom to top: FF — so 255 (decimal) = FF (hexadecimal).

This is why 255 is the maximum value of a single byte: 0xFF = 11111111 in binary = 8 bits all set to 1.

Octal and Unix File Permissions

Octal (base 8) is less common today but still appears in Unix/Linux file permissions. Each octal digit represents 3 binary bits:

OctalBinaryPermissions
7111rwx (read, write, execute)
6110rw- (read, write)
5101r-x (read, execute)
4100r— (read only)
0000--- (none)

The common chmod 755 command sets:

In binary: 111 101 101 = permission bits for a typical executable file.

Common Developer Use Cases

Color Codes (#RRGGBB)

CSS hex colors are 3 bytes (RGB) in hexadecimal. #1A2B3C means:

IPv4 Addresses

IP addresses are 32-bit numbers, sometimes expressed in hex. 192.168.1.1 = C0A80101 in hex.

Bitmasks and Flags

Programmers use binary and hex to work with bit flags. Checking if bit 3 is set: value & 0x08 (hex) or value & 0b00001000 (binary).

Memory Addresses

Debuggers and disassemblers display memory addresses in hexadecimal (e.g., 0x7FFE4000). Understanding hex lets you read and interpret these values.

ASCII and Unicode Code Points

Character code points are often expressed in hex. The letter A is U+0041 (hex 41 = decimal 65). The snowman emoji ☃ is U+2603 (hex 2603 = decimal 9731).

BigInt: No Overflow, No Precision Loss

Standard JavaScript numbers use 64-bit IEEE 754 floating-point arithmetic, which can only represent integers exactly up to 2^53 (about 9 quadrillion). Numbers larger than this lose precision silently — a serious problem for cryptographic keys, large hash values, and database IDs.

This converter uses JavaScript BigInt, which handles integers of arbitrary size with exact arithmetic. Whether you’re converting a 4-digit decimal or a 512-bit hexadecimal number, you get the correct result every time.

Grouped Display for Readability

Long binary strings are hard to read. This tool automatically groups binary output into sets of 4 bits (nibbles), mirroring how engineers annotate binary data:

Without grouping: 10101100101011001010
With grouping:    1010 1100 1010 1100 1010

Hexadecimal output is grouped in pairs of 2 digits (bytes):

Without grouping: DEADBEEF
With grouping:    DE AD BE EF

This matches the format used in hex editors, memory dumps, and protocol specifications.

Base Notation Reference

Different bases are often written with prefixes to avoid ambiguity:

BasePrefixExample
Binary (2)0b0b1010
Octal (8)0o or 00o12
Decimal (10)none10
Hexadecimal (16)0x0xA

Frequently Asked Questions

What is the largest number this tool can convert? There is no practical limit. The converter uses JavaScript BigInt, so it can handle numbers with thousands of digits accurately.

Does the tool support negative numbers? Yes. Prefix your input with - (e.g., -255) and the tool converts it correctly, preserving the sign in all outputs.

What happens with leading zeros? Leading zeros are stripped from the input (e.g., 0042 is treated as 42). This follows standard mathematical convention.

Can I convert text/strings to binary? This tool converts numeric values between bases. To convert text characters to binary, use the separate encoding tools — each character can be converted to its Unicode code point (a decimal number) and then to binary.

What is base 36? Base 36 uses digits 09 and letters AZ (26 + 10 = 36 symbols). It’s the largest base this tool supports and is used in URL shorteners, identifier generation, and compact numeric encodings where case-insensitivity is desired.

Related Tools