digiwleea Tools
Learn Open the lab →

Number base converter

Convert a number between binary, octal, decimal, and hexadecimal live: type a value in any box and the rest update instantly. There is also a custom field for any base from 2 to 36. The math uses BigInt, so very large values stay exact with no rounding. For example, 255 in decimal is 11111111 binary, 377 octal, and FF hex.

How to use it

Type a number in whichever box matches what you have: Binary for 0s and 1s, Octal for digits 0 to 7, Decimal for ordinary numbers, or Hexadecimal for 0 to 9 and A to F. The other boxes fill in as you type. For anything else, set the Base selector (2 to 36) and type into its field, using 0 to 9 then A to Z as digits.

Each box only accepts digits valid for its base, so a stray character shows a short note rather than corrupting the others. Hex and high custom bases accept upper or lower case and display in upper case. A leading minus sign is allowed, and clearing any box empties them all.

Worked example: 255 across bases

Start in decimal with 255. To reach binary, repeatedly divide by 2 and read the remainders from last to first; the result is 11111111, eight 1s. To reach octal, group those bits into threes from the right (011 111 111), which is 3 7 7, so 377. To reach hex, group the bits into fours (1111 1111), each group a hex digit F, giving FF.

The grouping shortcuts work because 8 is two cubed and 16 is two to the fourth: one octal digit is exactly 3 bits and one hex digit is exactly 4 bits. That is why hexadecimal is such a handy shorthand for binary.

What a base really means

A base is just how many distinct digits a number system uses, and therefore the multiplier between adjacent places. In base 10 the places are 1, 10, 100, 1000, each ten times the last. In base 2 they are 1, 2, 4, 8; in base 16, 1, 16, 256, 4096. The digits themselves run from 0 up to one less than the base, which is why bases above 10 borrow letters: A stands for 10, B for 11, on up to Z for 35 in base 36.

The number itself never changes, only the way it is written. 255, FF, and 11111111 are the same quantity in three costumes. Computers think in binary because a wire is either off or on; people lean on hex and decimal because they are shorter to read. Build the circuits that count in binary in the lab.

Frequently asked

How do I convert a number between bases?

To go to decimal, multiply each digit by its place value (the base raised to the digit's position) and add them up. To go from decimal to another base, divide repeatedly by the base and read the remainders bottom to top. This tool does both directions for binary, octal, decimal, hex, and any base 2 to 36 as you type.

What is 255 in binary, octal, and hex?

255 in decimal is 11111111 in binary, 377 in octal, and FF in hexadecimal. It is the largest value that fits in one 8-bit byte.

What bases can this converter handle?

Binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) always, plus any custom base from 2 to 36 using the digits 0 to 9 and then the letters A to Z. Values can be arbitrarily large because the math uses BigInt.

Bases are the foundation of everything else here. Read the theory on binary numbers and hexadecimal, or open the lab and build a counter that ticks through them.

Related tools: binary converter, two's complement converter, and text to binary.

Open the lab →

Embed this tool

Free to embed in your course page, blog, or notes: just keep the credit link under the widget. Paste this where you want it:

<iframe src="https://digiwleea.wleeaf.dev/embed/tool/?w=base-converter" width="100%" height="480" style="border:0;border-radius:12px;max-width:720px" title="Base converter" loading="lazy"></iframe>