Number Base Converter
Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36.
- Binary base 2
— - Octal base 8
— - Decimal base 10
— - Hexadecimal base 16
— —
Convert whole numbers between binary, hex and other bases
Number Base Converter takes a whole number written in one base and shows it in binary, octal, decimal and hexadecimal at the same time, plus one extra base of your choice from 2 to 36. The results change as you type, so there is no button to press.
The arithmetic uses JavaScript’s BigInt, which works with whole numbers of any size. A 64-bit hash, a 200-digit binary string or a long decimal ID converts digit for digit, without the rounding that ordinary floating-point numbers bring past about 16 digits. Everything happens in your browser; nothing you type is sent anywhere.
How to change a number from one base to another
- Type or paste the number into the Number box.
- Pick the base it is written in under From base. Binary, octal, decimal and hexadecimal are at the top of the list; every other base from 3 to 36 is listed under Other.
- Read the Binary, Octal, Decimal and Hexadecimal rows. For any other base, choose it in the Custom base row (it starts at 36).
- Tick Group digits if long values are hard to read, then use the copy button next to a row to copy its value.
What you can type and what you get back
- Prefixes: 0b for binary, 0o for octal and 0x for hexadecimal are accepted when they match the chosen base, in either case. Typing 0x1F while the base is set to decimal tells you to switch the base to 16 instead.
- Separators: spaces and underscores between digits are ignored, so 1111 0000, 1_000_000 and DEAD_BEEF all work.
- Letters: digits above 9 are the letters A to Z (A is 10, Z is 35). You can type them in upper or lower case; results are shown in upper case.
- Negative numbers: a leading minus sign is kept in every base, so −42 is −101010 in binary. The tool does not produce two’s-complement bit patterns.
- Grouping: binary and hexadecimal are split into groups of four digits, octal into groups of three and decimal gets thousands separators. Grouping only affects the display — the copy buttons always copy the plain digits.
When a base converter comes in handy
- Programming: turn a hex constant, bit mask or file permission (such as octal 755) into decimal, or the other way round.
- Colours: see the decimal value of a hex colour channel; for whole colours the Color Picker shows HEX, RGB and HSL together.
- Short IDs: base 36 packs large numbers into short strings of digits and letters, which some URL shorteners and database keys use.
- Learning: check homework on binary, octal and hexadecimal by watching each row change digit by digit.
- Hashes and checksums: convert a hex digest from the Hash Generator into one big decimal number, or back.
Number bases in brief
What a base means
A base says how many different digits a number system uses. Decimal has ten (0–9), so each position is worth ten times the one to its right. Binary has two (0 and 1), so positions are worth 1, 2, 4, 8 and so on. Hexadecimal has sixteen, using A–F for the values ten to fifteen.
Why binary and hex line up in groups of four
Sixteen is two to the power of four, so every hexadecimal digit stands for exactly four binary digits: F is 1111 and A is 1010. That is why the grouped binary row lines up with the hex row group for group, and why programmers write bytes as two hex digits.
Number Base Converter: common questions
Can it convert fractions or decimal points?
No. It works with whole numbers only, and typing a “.” shows a message saying so. Fractions in other bases often repeat forever, so they can’t always be written out exactly.
Is there a limit on how big the number can be?
Values are exact at any size. To keep the page responsive while you type, the input is limited to 10,000 characters.
Why does it say a digit isn’t valid?
Each base only allows digits below the base: base 8 uses 0–7, so an 8 or 9 can’t appear. The message names the first character that doesn’t fit and its position in the box, counting from 1, so you can find it quickly.
How do I get two’s complement for a negative number?
The tool writes negatives with a minus sign rather than as a fixed-width bit pattern. For an 8-bit two’s complement value, add 256 to the negative number first (−42 + 256 = 214) and convert that.
Does it handle base 64?
No — bases go from 2 to 36, which is all the digits plus the 26 letters. Base64 is an encoding for bytes rather than a way of writing numbers; use the Base64 Encoder for that.
Are upper-case and lower-case letters the same?
Yes. ff, FF and Ff are all 255 in hexadecimal. The results always use upper-case letters, which you can change after pasting if your code style needs lower case.

