NUMBER BASE CONVERTER GUIDE
Number Base Converter – Free Online Binary, Decimal, Hexadecimal and Octal Converter for Any Base from 2 to 36
Need to turn a decimal number into binary, a hex colour code into decimal, or an octal file permission into binary? Our free number base converter does every one of those conversions in a fraction of a second. Type a number, choose whether it is binary, octal, decimal, hexadecimal or any custom base from 2 to 36, and you instantly see the same value in all four common bases plus one extra base of your choice. The tool also shows a bit view of the binary value, the bit length, the number of bits set to 1, the bytes needed, the matching Unicode character and the two's complement form for 8, 16, 32 and 64 bits. It handles very large numbers exactly, accepts negative values and understands prefixes such as 0b, 0o and 0x, so you can paste values straight from code. There is no signup, no app to install and nothing is stored, so students, programmers, network engineers, electronics hobbyists and cybersecurity learners can use this online base converter as often as they like. Whether you searched for a binary to decimal converter, a decimal to binary converter, a hex to decimal converter, a decimal to hex converter, a binary to hex converter, a hex to binary converter, an octal to decimal converter, a base 2 to base 10 calculator, a radix converter, a base 36 converter, a two's complement calculator or a simple way to understand how number systems work, this one page covers it all. It works on phones, tablets and computers, so you can check a value in class, in an exam revision session, at your desk or on a server console.
BIN
Binary to Decimal and Decimal to Binary Converter
Use the binary converter to change a string of 0s and 1s into a decimal number, or turn any decimal number into binary. Choose Binary as the input base to read a bit pattern such as 11010110, or choose Decimal to see the binary form of 214. The bit view shows each bit as a lit square, grouped in bytes, which makes it easy to see how computers store a number and to spot patterns like powers of two.
HEX
Hex to Decimal and Hex to Binary Converter
Hexadecimal is the favourite shorthand of programmers, web designers and engineers. Paste a value such as FF, 2F3 or 0x7FFF and get the decimal, binary and octal forms at once. Because each hex digit equals exactly four bits, the hex to binary converter output lines up neatly in groups of four, which is perfect for reading colour codes, memory addresses, MAC addresses, byte values and machine code.
2-36
Octal and Custom Base Converter (Base 2 to 36)
Work with octal for Unix file permissions such as chmod 755, or go beyond the usual four systems with any base from 2 to 36. Pick a custom input base and a custom output base to convert between base 3, base 5, base 12, base 20, base 32 or base 36, using digits 0 to 9 and letters A to Z. It is a flexible radix converter for homework, puzzles, short IDs and compact number encoding.
What Is a Number Base (Radix)? Positional Number Systems Explained
A number base, also called a radix, is the number of different digits a counting system uses before it rolls over to the next position. We use base 10, or decimal, in daily life because we count with ten digits, from 0 to 9. After 9 the next number needs a new position, so we write 10. Every other positional number system works in exactly the same way. Binary is base 2 and uses only 0 and 1. Octal is base 8 and uses 0 to 7. Hexadecimal is base 16 and uses 0 to 9 followed by A to F for the values 10 to 15.
In a positional system, the value of a digit depends on where it stands. Each position carries a weight that is a power of the base. In decimal the weights are 1, 10, 100, 1,000 and so on, so 345 means 3 x 100 + 4 x 10 + 5 x 1. In binary the weights are 1, 2, 4, 8, 16, 32, 64, 128 and so on, so 1011 means 1 x 8 + 0 x 4 + 1 x 2 + 1 x 1 = 11. Once you understand that the only thing changing between systems is the base, converting between them becomes a simple, repeatable method, and a number base converter just does that method for you without mistakes.
Binary, Octal, Decimal and Hexadecimal Compared
The four systems below cover almost everything you will meet in school, programming and networking. The table shows the base, the digits used, the usual prefix in code and where each system is most often used.
Common number systems and where they are used
| System |
Base |
Digits |
Code prefix |
Typical use |
| Binary | 2 | 0, 1 | 0b | Computer hardware, logic, bit flags, networking masks |
| Octal | 8 | 0 to 7 | 0o (or 0) | Unix and Linux file permissions |
| Decimal | 10 | 0 to 9 | none | Everyday counting, money, measurements |
| Hexadecimal | 16 | 0 to 9, A to F | 0x (or #) | Colour codes, memory addresses, byte values, debugging |
| Base 32 / Base 36 | 32 / 36 | 0 to 9, A to Z | none | Short IDs, compact codes, URL slugs |
Computers use binary because digital circuits have two stable states, on and off. Long binary strings are hard for people to read, so hexadecimal and octal act as compact shorthand. One hex digit equals exactly four bits, and one octal digit equals exactly three bits, which is why programmers convert between them so often.
Decimal, Binary, Octal and Hex Conversion Table (0 to 20)
This quick reference table shows the first twenty-one whole numbers in all four common bases. It is handy for revision and for spotting the pattern in how each system counts. Use the converter above for any value that is not listed.
Number conversion chart: decimal, binary, octal and hexadecimal
| Decimal |
Binary |
Octal |
Hexadecimal |
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 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 |
| 16 | 10000 | 20 | 10 |
| 17 | 10001 | 21 | 11 |
| 18 | 10010 | 22 | 12 |
| 19 | 10011 | 23 | 13 |
| 20 | 10100 | 24 | 14 |
How to Convert Decimal to Binary (Division by 2 Method)
The standard way to convert a decimal number to binary is repeated division by 2. Divide the number by 2, write down the remainder (always 0 or 1), then divide the quotient by 2 again, and keep going until the quotient reaches 0. The binary number is the list of remainders read from the last one to the first. The same method works for any other base: divide by 8 for octal, by 16 for hex, or by the base you need.
Example: converting decimal 156 to binary
| Division |
Quotient |
Remainder (bit) |
| 156 / 2 | 78 | 0 |
| 78 / 2 | 39 | 0 |
| 39 / 2 | 19 | 1 |
| 19 / 2 | 9 | 1 |
| 9 / 2 | 4 | 1 |
| 4 / 2 | 2 | 0 |
| 2 / 2 | 1 | 0 |
| 1 / 2 | 0 | 1 |
Reading the remainders from bottom to top gives 10011100, so decimal 156 equals binary 10011100. You can check it by adding the weights: 128 + 16 + 8 + 4 = 156. Type 156 into the converter above, keep Decimal as the input base, and you will see the same answer instantly, along with the octal value 234 and the hex value 9C.
How to Convert Binary to Decimal (Place Value Method)
To convert binary to decimal, write the weight of each bit position above the digits, starting with 1 on the right and doubling as you move left. Then add up the weights wherever the bit is 1. Ignore the positions that hold a 0. This is called the place value method, and it is the fastest way to convert by hand once you remember the powers of two.
Example: binary 11010110 to decimal
| Bit weight |
128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
| Bit value | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 |
| Adds up to | 128 | 64 | 0 | 16 | 0 | 4 | 2 | 0 |
Adding 128 + 64 + 16 + 4 + 2 gives 214, so binary 11010110 equals decimal 214. In the converter, choose Binary as the input base, paste the bits (spaces are ignored) and read the decimal row.
How to Convert Hexadecimal to Decimal and Binary
A hex number is converted to decimal by multiplying each digit by a power of 16 and adding the results. The rightmost digit has weight 1, the next has weight 16, then 256, then 4,096 and so on. Letters stand for values above 9: A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15. For example, hex 2F3 equals 2 x 256 + 15 x 16 + 3 x 1 = 512 + 240 + 3 = 755.
Converting hex to binary is even easier, because each hex digit maps to exactly four bits. Replace every digit with its four-bit group and join them. Hex 2F3 becomes 0010 1111 0011, which is 1011110011 once the leading zeros are dropped. The table below lists all sixteen hex digits with their binary and decimal values, and it is worth memorising because it makes hex and binary conversion almost instant.
Hex digit to 4-bit binary and decimal
| Hex | Binary | Decimal |
Hex | Binary | Decimal |
| 0 | 0000 | 0 | 8 | 1000 | 8 |
| 1 | 0001 | 1 | 9 | 1001 | 9 |
| 2 | 0010 | 2 | A | 1010 | 10 |
| 3 | 0011 | 3 | B | 1011 | 11 |
| 4 | 0100 | 4 | C | 1100 | 12 |
| 5 | 0101 | 5 | D | 1101 | 13 |
| 6 | 0110 | 6 | E | 1110 | 14 |
| 7 | 0111 | 7 | F | 1111 | 15 |
Binary to Hex Shortcut: Group Bits in Fours
You never need to go through decimal to convert between binary and hex. Split the binary number into groups of four bits starting from the right, add zeros on the left of the first group if it is short, and replace each group with its hex digit. The binary number 1101 0110 becomes D and 6, so the hex value is D6. To go back, replace each hex digit with its four bits. The same shortcut works for octal with groups of three bits: 110 101 becomes 6 and 5, so binary 110101 is octal 65. Because the converter groups its binary output in fours and its hex output in pairs, you can see these shortcuts at work in the results.
Octal Numbers and Linux File Permissions (chmod)
Octal is still very much alive in Unix and Linux file permissions. Each permission digit is a three-bit group where the bits mean read (4), write (2) and execute (1). Adding the bits gives one octal digit per class of user: owner, group and others. So the commonly used chmod 755 means rwx for the owner, r-x for the group and r-x for others. Type 755 into the converter with Octal as the input base to see its binary form 111 101 101, which is exactly those nine permission bits.
Octal permission digit, binary bits and meaning
| Octal digit |
Binary |
Permission |
Meaning |
| 7 | 111 | rwx | Read, write and execute |
| 6 | 110 | rw- | Read and write |
| 5 | 101 | r-x | Read and execute |
| 4 | 100 | r-- | Read only |
| 0 | 000 | --- | No access |
Other common modes include 644 (rw-r--r--, typical for web files), 755 (rwxr-xr-x, typical for scripts and folders) and 777 (rwxrwxrwx, full access for everyone, which is usually unsafe on a public server).
Powers of 2 Table: Binary, Decimal and Hex Values
Powers of two are the building blocks of binary numbers, memory sizes and storage limits. Knowing the first few by heart makes mental binary conversion much faster, and it helps you understand why computers use values such as 256, 1,024 and 65,536 so often.
Powers of 2 with binary and hexadecimal forms
| Power |
Decimal value |
Hexadecimal |
Where you see it |
| 2^0 | 1 | 1 | Single bit |
| 2^4 | 16 | 10 | One hex digit (a nibble) |
| 2^7 | 128 | 80 | Highest bit of a byte |
| 2^8 | 256 | 100 | Values in one byte (0 to 255) |
| 2^10 | 1,024 | 400 | One kibibyte |
| 2^16 | 65,536 | 10000 | 16-bit values, TCP and UDP ports |
| 2^20 | 1,048,576 | 100000 | One mebibyte |
| 2^24 | 16,777,216 | 1000000 | Number of 24-bit RGB colours |
| 2^32 | 4,294,967,296 | 100000000 | IPv4 address space, 32-bit limit |
Negative Numbers and Two's Complement Explained
Computers store negative whole numbers using two's complement, because it lets the same circuits add and subtract without special cases. To find the two's complement of a negative number, write its positive value in binary using a fixed width such as 8 bits, invert every bit and add 1. For -100 in 8 bits, the positive value 100 is 01100100, inverting gives 10011011 and adding 1 gives 10011100, which is hex 9C. The same bit pattern is also the unsigned number 156, so the meaning depends on whether the program reads the bits as signed or unsigned. The leftmost bit is the sign bit: 0 means positive and 1 means negative.
8-bit two's complement examples
| Decimal |
8-bit binary |
Hex |
Note |
| 127 | 0111 1111 | 7F | Largest signed 8-bit value |
| 1 | 0000 0001 | 01 | Positive one |
| 0 | 0000 0000 | 00 | Zero |
| -1 | 1111 1111 | FF | All bits set |
| -2 | 1111 1110 | FE | One less than -1 |
| -100 | 1001 1100 | 9C | Same bits as unsigned 156 |
| -128 | 1000 0000 | 80 | Smallest signed 8-bit value |
Signed integer ranges by bit width
| Width |
Smallest value |
Largest value |
| 8-bit | -128 | 127 |
| 16-bit | -32,768 | 32,767 |
| 32-bit | -2,147,483,648 | 2,147,483,647 |
| 64-bit | -9,223,372,036,854,775,808 | 9,223,372,036,854,775,807 |
Choose the width in the converter and it shows the two's complement binary and hex for your number, or tells you when the value does not fit in that signed range. This is helpful for debugging integer overflow, reading memory dumps and understanding why 255 and -1 look the same in 8 bits.
Bits, Nibbles and Bytes: How Binary Maps to Computer Memory
A bit is a single binary digit, 0 or 1. Four bits form a nibble, which is exactly one hex digit. Eight bits form a byte, which can hold 256 different values from 0 to 255 (hex 00 to FF). Larger values use more bytes: 16 bits hold up to 65,535 unsigned, 32 bits hold up to 4,294,967,295 and 64 bits hold up to 18,446,744,073,709,551,615. The bit view in the converter shows your number grouped in bytes, and the Bit length, Bits set to 1 and Bytes needed values tell you how much space the number would take. Counting the bits set to 1 is also called the population count, which is used in checksums, flags and algorithms.
Hexadecimal in Web Design: Colour Codes and RGB
Every six-digit hex colour code, such as #FF5733, is three hex bytes written side by side: red, green and blue. Each pair is a number from 00 to FF, which is 0 to 255 in decimal. Splitting #FF5733 gives FF (255), 57 (87) and 33 (51), so the colour is rgb(255, 87, 51). To convert a colour yourself, enter each pair into this converter with Hex as the input base and read the decimal value.
Common hex colours and their RGB values
| Colour |
Hex code |
Red, green, blue (decimal) |
| Black | #000000 | 0, 0, 0 |
| White | #FFFFFF | 255, 255, 255 |
| Red | #FF0000 | 255, 0, 0 |
| Green | #00FF00 | 0, 255, 0 |
| Blue | #0000FF | 0, 0, 255 |
| Orange-red | #FF5733 | 255, 87, 51 |
Binary in Networking: IP Addresses and Subnet Masks
An IPv4 address is four 8-bit numbers separated by dots, so every part is a value from 0 to 255 that can be written as eight binary digits. Network engineers convert these parts to binary to work out subnets and masks. For example, 192.168.1.1 is 11000000.10101000.00000001.00000001. A subnet mask of 255.255.255.0 is 24 ones followed by 8 zeros, written as /24 in CIDR notation. Converting each octet with the tool above is a fast way to check your subnetting homework or a firewall rule.
Common IPv4 octets in decimal, binary and hex
| Decimal |
8-bit binary |
Hex |
Where you see it |
| 10 | 00001010 | 0A | Private 10.x.x.x network |
| 128 | 10000000 | 80 | First bit of a mask |
| 168 | 10101000 | A8 | 192.168.x.x home networks |
| 172 | 10101100 | AC | Private 172.16 to 172.31 range |
| 192 | 11000000 | C0 | 192.168.x.x home networks |
| 255 | 11111111 | FF | Full octet in a subnet mask |
ASCII and Unicode: Characters as Numbers
Text is stored as numbers. In ASCII, each character has a code between 0 and 127, and Unicode extends this to more than a million code points. The capital letter A has the decimal code 65, which is 01000001 in binary and 41 in hex. The converter shows the Unicode character for your value when it falls in the valid range, which makes it a handy quick check for character codes while you work on strings, encodings or escape sequences.
Sample ASCII codes in decimal, binary and hex
| Character |
Decimal |
Binary |
Hex |
| Space | 32 | 00100000 | 20 |
| 0 | 48 | 00110000 | 30 |
| A | 65 | 01000001 | 41 |
| a | 97 | 01100001 | 61 |
Base 32, Base 36 and Custom Bases: Going Beyond Hexadecimal
Hexadecimal is not the end of the line. Using digits 0 to 9 and letters A to Z, you can write numbers in any base up to 36. Base 36 packs a lot of information into few characters, which is why it is used for short codes, compact IDs and URL shorteners. For example, the decimal number 1,000,000 is written as LFLS in base 36, and 255 is 73. Base 32 is another popular choice for human-friendly codes. Choose a custom input or output base in the converter to explore these systems. Note that Base64, used to encode files and tokens, is an encoding of bytes and not a number base in the same sense, so it is not part of this converter.
How to Use This Number Base Converter (Step by Step)
Using the number base converter takes only a few seconds, and the results update while you type. Follow these steps for any conversion.
- Type your number: Enter the digits. You can add a minus sign, and prefixes like 0x, 0b or 0o are accepted when they match the input base.
- Choose the input base: Select Binary, Octal, Decimal, Hex or Custom, and pick a base from 2 to 36 for Custom.
- Read all bases at once: The Binary, Octal, Decimal and Hexadecimal rows appear together, plus an extra base you choose.
- Tune the display: Turn digit grouping, prefixes and uppercase letters on or off to match how you will use the result.
- Check the bit view and stats: See each bit, the bit length, set bits, bytes needed and the Unicode character.
- Check two's complement: Pick 8, 16, 32 or 64 bits to see how a negative or positive value is stored.
- Copy a result: Press Copy on any row to copy that value without spaces or separators.
Spaces, commas and underscores inside the number are ignored, so you can paste values such as 1111 0000 or 1_000_000 directly.
Common Number Base Conversion Mistakes to Avoid
A few small slips cause most conversion errors. Knowing them saves time on exams and in code.
- Reading remainders in the wrong order: When dividing by the base, read the remainders from last to first, not first to last.
- Using a digit that is too big: A digit must be smaller than the base. The digit 8 is not valid in binary or octal, and G is not valid in hex.
- Mixing up hex letters: A to F equal 10 to 15. Remember that B is 11 and D is 13, not 2 and 4.
- Forgetting leading zeros: In grouped binary and hex, leading zeros keep the bit width correct, even if they do not change the value.
- Confusing signed and unsigned: The same bits can mean 156 or -100 in 8 bits, depending on how a program reads them.
- Treating 0b, 0o and 0x as digits: They are only prefixes that tell you the base.
Common Uses: Who Needs a Number Base Converter?
A number base converter is useful far beyond the classroom. Here are some of the most popular ways people use it.
- Computer science students: Practise binary, octal and hex conversion and check homework answers.
- Programmers and developers: Read bitmasks, flags, hex literals, memory addresses and byte values.
- Web designers: Convert hex colour pairs to RGB values and back.
- Network engineers: Convert IP address octets and subnet masks between decimal and binary.
- Electronics and embedded hobbyists: Work with registers, microcontroller values and logic levels.
- Cybersecurity learners: Decode hex dumps, byte sequences and encoded data in exercises and CTFs.
- System administrators: Translate chmod octal permissions into readable bits.
Is This Converter Accurate? Limitations You Should Know
The converter uses arbitrary-precision integers, so very long numbers convert exactly, without the rounding problems that normal floating-point numbers have. It works with whole numbers only. Fractions such as 0.1 in binary, floating-point formats such as IEEE 754, and Base64 or other text encodings are outside its scope. Letters are case-insensitive on input, so ff and FF mean the same. For work that depends on a specific bit width, such as signed overflow or a protocol field, use the two's complement view and confirm the width your system uses.
Free Online Number Base Converter on Any Device, No App Needed
Our number base converter runs in your web browser, so you can use it on Windows, Mac, Linux, Android and iPhone without installing anything. Whether you are looking for a binary converter for mobile, a hex converter for PC, a radix calculator app alternative or a quick way to check a value during a lab, the steps are the same. Open the page, type your number, choose the base and read the results instantly. There is no account to create and no email to confirm, and because the conversion happens on your own device, your numbers stay private. The page loads fast even on slow connections and adapts to small screens, so it is just as comfortable on a phone as on a desktop.
Free Binary, Decimal, Hex and Octal Converter: Fast, Private and Easy to Understand
Our free number base converter was built to make number systems simple. You get every common base at once, any base from 2 to 36, a bit view, two's complement, Unicode lookup and copy buttons, all with exact results for numbers of any size. We never ask for your name or email, and we never store the numbers you enter. Use it whenever you study, code, design or troubleshoot, and come back as often as you like.
Ready to try it? Scroll back up, type your number, choose the input base and see the results in seconds. If you enjoy simple everyday utilities, explore the other free tools on our site, including our BMI calculator, water intake calculator and sales tax calculator.