Mubarak4u

Number Base Converter (Binary, Decimal, Hexadecimal, Octal)

Convert numbers across binary, decimal, hexadecimal, octal, and custom bases from 2 to 36. Bidirectional real-time conversion with BigInt precision, bit-length statistics, and digit grouping.

Quick Examples:
Bit Length
8 bits
Byte Length
1 byte
Signed 8-Bit
-1

Use this number base converter to turn a number between binary, decimal, hexadecimal, octal and any custom base from 2 to 36. Type a value in any box and the other boxes update at once. Everything runs in your browser, so nothing you type leaves your device. It uses BigInt, so even very large whole numbers convert exactly, with no rounding.

How to convert between number systems

  1. Type or paste a value in any box: Decimal (Base 10), Binary (Base 2), Hexadecimal (Base 16), Octal (Base 8) or Custom Base. The boxes already hold 255 as an example, and the other boxes update as you type each character.
  2. Use only the digits that base allows: 0 and 1 for binary, 0 to 7 for octal, 0 to 9 and A to F for hexadecimal, and 0 to 9 plus letters up to the base you picked for the custom base. Small letters work too, and the tool turns them into capitals. Spaces, commas and underscores in what you paste are ignored. You can also type 0xFF in the hex box, 0b1010 in the binary box or 0o755 in the octal box, and the tool reads the prefix.
  3. Tick Group 4s to show the binary value in four-bit blocks, like 1111 1111. Tick 0x Prefix to show the hex value with 0x in front, like 0xFF.
  4. Pick any custom base from the dropdown, from Base 2 to Base 36. It starts at Base 32, and 255 shows as 7V in base 32.
  5. Read the three cards below the boxes: Bit Length, Byte Length and Signed 8-Bit. For 255 they read 8 bits, 1 byte and -1, because the same eight bits read as -1 when treated as a signed 8-bit number.
  6. Tap a Quick Example to try one: 255 (0xFF), 1024 (1 KB), 65,535 (16-bit) or 16,777,215 (24-bit). Tap Reset All to go back to 255.
  7. Click Copy beside any box to copy its value. The button changes to Copied! when it works.

How the conversion works

Every digit in a number has a place value, which is a power of the base. In binary the places are 8, 4, 2 and 1, so 1010 means 1 × 8 + 0 × 4 + 1 × 2 + 0 × 1, which is 10 in decimal. To go from decimal to hexadecimal, divide by 16 and keep the remainders: 255 ÷ 16 is 15 remainder 15, and 15 is F, so 255 is FF. Binary converts to hex and octal without any arithmetic, because 16 and 8 are powers of 2. Split the bits into groups of four for hex, so 1111 1111 becomes F and F, and into groups of three for octal, so 011 111 111 becomes 3, 7 and 7, which gives 377.

Where each base is used

BaseDigitsCommon use
Binary (2)0 and 1How computers store data as bits
Octal (8)0 to 7Unix and Linux file permissions, such as chmod 755
Decimal (10)0 to 9Everyday numbers
Hexadecimal (16)0 to 9 and A to FColour codes, memory addresses and byte values

A web colour such as #FF8800 is three hex bytes: FF is 255, 88 is 136 and 00 is 0, so the colour is rgb(255, 136, 0). In chmod 755, each digit is three permission bits: 7 is 111 (read, write, execute) and 5 is 101 (read and execute), which gives rwxr-xr-x.

An example: 255

Decimal 255 is binary 1111 1111, hex FF, octal 377 and 7V in base 32. The binary value is eight 1s, so Bit Length reads 8 bits and Byte Length reads 1 byte. Tap 1024 (1 KB) and the cards change to 11 bits, 2 bytes and N/A (> 8-bit) for the signed reading, because 1024 is too big for 8 bits.

Big numbers convert exactly

The converter works with BigInt, so very large whole numbers convert exactly. Normal JavaScript numbers lose precision above 9,007,199,254,740,992, but this tool does not use them. For example, the 30-digit number 123456789012345678901234567890 converts to hex 18EE90FF6C373E0EE4E3F0AD2, digit for digit, with 97 bits and 13 bytes.

What this base converter can’t do

If you type a digit that is not valid for that base, the other boxes go blank and the cards read 0 bits, 0 bytes and N/A. Type a valid digit and they fill in again. Decimals are not supported, because a decimal point is not a valid digit in any base, so only whole numbers convert. Signed 8-Bit shows a number only for values from 0 to 255, and above 255 it reads N/A (> 8-bit). Negative numbers work only as a minus sign in front: type -255 and every box shows the negative value, but the tool does not show two’s complement bit patterns for negatives.

Frequently Asked Questions

How do I convert binary to decimal?

Add the place values of every 1. For 1010 the places are 8, 4, 2 and 1, so 8 + 2 = 10. You can also type the binary number in the Binary box and read the answer in the Decimal box.

How do I convert decimal to hexadecimal?

Divide the number by 16 and write down the remainders from last to first, using A to F for 10 to 15. For 255, 255 ÷ 16 is 15 remainder 15, so the answer is FF. Or type 255 in the Decimal box and read the Hexadecimal box.

Why does hexadecimal use letters A to F?

Base 16 needs 16 different digits, and the usual 0 to 9 gives only ten. So A stands for 10, B for 11, C for 12, D for 13, E for 14 and F for 15. The custom base works the same way up to Base 36, which uses all letters up to Z.

What do 0x, 0b and 0o mean?

They are prefixes that many programming languages use to mark the base of a number: 0x for hexadecimal, 0b for binary and 0o for octal. This converter accepts them, so you can type 0xFF, 0b1010 or 0o755 in the matching box.

What is the largest number this converter can handle?

The tool does not set a limit, because it uses BigInt, which keeps every digit exact. Very long numbers only make your browser slower, and the 30-digit example in this page converts instantly.

Why do the other boxes go blank when I type?

A digit that is not valid for that base was typed. A 2 in the Binary box or a G in the Hexadecimal box, for example, is not allowed. Remove it, and the other boxes fill in again.

Does this converter work with decimals or fractions?

No. It converts whole numbers only, because a decimal point is not a valid digit in any base. Convert the whole part and the fraction part with a method that handles fractions.

Last updated: November 14, 2026