About Number Base Converter
Number Base Converter is a free tool that runs in your browser with no sign-up, so the numbers you enter are never uploaded. Type a number in any base from 2 to 36 and see it in binary, octal, decimal and hexadecimal at once, plus one extra base of your choice and the base you picked as the target.
It handles more than the textbook case. Negative numbers work, fractions are converted with any repeating block shown in brackets, and integers can be as long as you like because the arithmetic uses big integers instead of ordinary floating-point numbers. A two’s complement option shows the 8, 16, 32 or 64-bit pattern of a signed integer, and a Show steps option writes out the working, including the repeated multiplication used for fractions.
A second mode converts text to bytes and back. Text is encoded as UTF-8 and shown in binary, octal, decimal or hexadecimal, and bytes in those bases are decoded back to text. An ASCII table from 0 to 127 is included for reference.
Digits above 9 are written as letters, so A is 10, F is 15 and Z is 35. Prefixes 0b, 0o and 0x are accepted for binary, octal and hexadecimal, and spaces, commas and underscores in a number are ignored.
How to use Number Base Converter
- Choose the Numbers mode to convert a value, or Text and ASCII to convert text.
- In Numbers mode, pick the base you are starting from, then type the number. Use a minus sign for negatives and a point for a fraction.
- Pick the target base. The result for binary, octal, decimal and hexadecimal appears together, with the target base and an extra base you can choose.
- Show steps is on by default. Turn on Group digits to split long results into blocks of 4 (binary and hex) or 3 digits.
- Turn on two’s complement and pick 8, 16, 32 or 64 bits to see how a signed whole number is stored.
- In Text mode, choose encode or decode and the base (2, 8, 10 or 16), then enter text or the bytes to decode.
Features
- Any base from 2 to 36, with results shown in binary, octal, decimal and hexadecimal together.
- Negative numbers and fractions, with a repeating block detected and shown in brackets, such as 0.0(0011) for 0.1.
- Step-by-step working for fractions by repeated multiplication, as well as for whole numbers.
- Big integers, with no 53-bit limit.
- Two’s complement for 8, 16, 32 and 64-bit signed integers.
- Step-by-step working for whole numbers: place values for the source base and repeated division for the target.
- Digit grouping in blocks of 4 or 3 for readable bit patterns.
- Text to and from UTF-8 bytes in bases 2, 8, 10 and 16.
- An ASCII table for codes 0 to 127 with decimal, hex, octal, binary and the character.
- Prefixes 0b, 0o and 0x accepted, and spaces, commas and underscores ignored.
- A copy button on each result.
How base conversion works
In base b, each digit is worth a power of b, counted from the right starting at 0. To convert to decimal, multiply each digit by its power and add. 1011 in binary is 1 × 8 + 0 × 4 + 1 × 2 + 1 × 1 = 11.
To convert from decimal to base b, divide by b repeatedly and write down each remainder. The remainders, read from the last to the first, are the digits. For fractions, multiply the fractional part by b repeatedly and read the integer parts from first to last.
Binary, octal and hexadecimal are related because 8 = 2³ and 16 = 2⁴. Group binary digits in threes for octal or fours for hexadecimal and convert each group on its own.
value = dₙ × bⁿ + … + d₁ × b¹ + d₀ × b⁰
decimal to base b: divide by b, keep remainders, read bottom to topWorked examples
156 (decimal) to binary gives 10011100
Repeated division by 2 gives the remainders 0, 0, 1, 1, 1, 0, 0, 1; read from the bottom: 10011100.
10011100 (binary) to hex gives 9C
Groups 1001 and 1100 are 9 and C.
FF (hex) to decimal gives 255
15 × 16 + 15 = 255.
755 (octal) to decimal gives 493
7 × 64 + 5 × 8 + 5 = 493.
0.1 (decimal) to binary gives 0.0(0011)
The fraction does not end in binary: the block 0011 repeats forever, shown in brackets.
The common number bases
| Base | Radix | Digits | Ten written in it | Typical use |
|---|---|---|---|---|
| Binary | 2 | 0 and 1 | 1010 | Computer hardware, bit flags, networking masks |
| Octal | 8 | 0 to 7 | 12 | Unix file permissions such as 755 |
| Decimal | 10 | 0 to 9 | 10 | Everyday counting and arithmetic |
| Hexadecimal | 16 | 0 to 9 and A to F | A | Memory addresses, color codes, byte values |
| Base 36 | 36 | 0 to 9 and A to Z | A | Short IDs and compact numbers |
0 to 15 in binary, octal and hexadecimal
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Good to know
Worked example: 156 to binary
156 ÷ 2 = 78 remainder 0
78 ÷ 2 = 39 remainder 0
39 ÷ 2 = 19 remainder 1
19 ÷ 2 = 9 remainder 1
9 ÷ 2 = 4 remainder 1
4 ÷ 2 = 2 remainder 0
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1
Read the remainders from bottom to top: 10011100
Fractions and the 20-digit limit
Fractions are converted exactly. Many fractions cannot be written with a finite number of digits in another base: 0.1 in decimal repeats forever in binary. The converter finds the repeating block and shows it in brackets, as in 0.0(0011). Only if no repeat appears within 64 digits is the result cut, and it is then marked with an ellipsis.
Steps are shown for whole numbers and for fractions. Two’s complement works on whole numbers. A number that does not fit the width you chose, such as 200 in 8-bit signed, triggers a warning and the low bits that would result are labelled as wrapped, never presented as the answer.
Text mode and UTF-8
Text is encoded as UTF-8 before it is shown as numbers. Plain English letters take one byte each, which matches ASCII, but a character such as an accented letter or a Bangla letter takes two or three bytes. When you decode, the bytes must form valid UTF-8 or the result will contain replacement characters.
Privacy: how it works
- All conversions are done by code running in your browser tab. The numbers and text you enter are never sent to Ulkaa or anyone else.
- There is no account and no sign-up, and the tool costs nothing to use.
Tips
- Use Group digits to read long binary numbers: blocks of 4 line up with hex digits.
- Pick binary to hex when you want to read bits quickly: convert each group of four on its own.
- Use two’s complement with the width of your data type, for example 8 bits for a byte and 32 bits for a typical integer.
- If a result has a repeating block in brackets, the digits inside repeat forever, so a stored value is only an approximation of it.
Frequently asked questions
Is it really free?
Yes. There is no price, no trial and no credit card. Ulkaa Tool does the work with your own device, so there is no server bill to pass on to you.
Do I need an account?
No. There is no sign-up and no login. Open the page and use it. An Ulkaa account is not needed for anything on this tool.
Does it run in my browser?
Yes. Your numbers are processed by code running in your browser tab, on your own device.
Is my data uploaded?
No. Your numbers are never sent to Ulkaa or to anyone else. You can check this yourself by watching the Network tab in your browser developer tools while you use the tool.
How do I convert binary to decimal?
Write the powers of two under the digits, starting with 1 on the right and doubling each step to the left. Add the powers that sit under a 1. For 1011 that is 8 + 2 + 1 = 11.
How do I convert hex to binary?
Replace each hex digit with its four-digit binary form: 0 is 0000, 9 is 1001, A is 1010 and F is 1111. So 2F is 0010 1111.
What is two’s complement?
It is the usual way computers store signed integers. To get the pattern of a negative number, write the positive number in binary, flip every bit and add 1. In 8 bits, -1 is 11111111 and -128 is 10000000.
How do I convert text to binary?
Switch to Text and ASCII mode, choose Encode and base 2, and type the text. Each character is turned into its UTF-8 byte or bytes, and each byte is shown as 8 binary digits. The letter A is 01000001.
Which bases are supported?
Every base from 2 to 36. Digits above 9 are the letters A to Z, so base 36 uses all ten digits and all 26 letters.
Is there a size limit?
Not an ordinary one. Whole numbers use big integers, so they can have hundreds of digits. Fractions show their repeating block. Two’s complement is limited to 8, 16, 32 or 64 bits.
Popular Number Base Converter pages
- Binary to Decimal ConverterTurn a binary number into decimal, with the working shown.
- Decimal to Binary ConverterTurn a decimal number into binary, with the working shown.
- Binary to Hex ConverterTurn a binary number into hexadecimal, with the working shown.
- Hex to Binary ConverterTurn a hexadecimal number into binary, with the working shown.
- Decimal to Hex ConverterTurn a decimal number into hexadecimal, with the working shown.
- Hex to Decimal ConverterTurn a hexadecimal number into decimal, with the working shown.
- Decimal to Octal ConverterTurn a decimal number into octal, with the working shown.
- Octal to Decimal ConverterTurn an octal number into decimal, with the working shown.
- Binary to Octal ConverterTurn a binary number into octal, with the working shown.
- Octal to Binary ConverterTurn an octal number into binary, with the working shown.
- Hex to Octal ConverterTurn a hexadecimal number into octal, with the working shown.
- Octal to Hex ConverterTurn an octal number into hexadecimal, with the working shown.
- Binary to Text ConverterTurn binary bytes into text.
- Text to Binary ConverterTurn text into binary bytes.
- Binary to ASCII ConverterTurn binary bytes into ASCII text.
- Hex to Text ConverterTurn hex bytes into text.
- Text to Hex ConverterTurn text into hex bytes.
- ASCII Table: Codes 0 to 127All 128 ASCII characters with their decimal, hex, octal and binary codes.