Skip to content

Number Base Converter

Convert binary, octal, decimal and hexadecimal in one step, or use any base from 2 to 36. Handles huge numbers, negatives, two's complement and shows a bit view. Free, private and no signup.

  • 100% free
  • No Signup
  • Bin, Oct, Dec, Hex & Base 2-36

Enter your number

Convert from
Quick examples
Your Privacy Matters

Everything is converted inside your browser. The numbers you type are never uploaded, saved or stored.

Your result

Binarybase 2--
Octalbase 8--
Decimalbase 10--
Hexadecimalbase 16--
Base 36your choice--
Bit length
--
Bits set to 1
--
Bytes needed
--
Unicode character
--
Two's complement (32-bit)

--

This number base converter works with whole numbers (integers). It is for learning and general use. Always double-check critical values, such as memory addresses or security settings, in your own environment.

ADVERTISEMENT
Demo Ad 728 x 90 320 x 100

How to convert a number between bases

  1. 1

    Type your number

    Enter digits, with an optional minus sign or a prefix such as 0x or 0b.

  2. 2

    Pick the input base

    Choose binary, octal, decimal, hex or any custom base from 2 to 36.

  3. 3

    Copy your results

    See every base at once, plus bit view and two's complement, and copy any row.

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.

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 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.

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
Binary20, 10bComputer hardware, logic, bit flags, networking masks
Octal80 to 70o (or 0)Unix and Linux file permissions
Decimal100 to 9noneEveryday counting, money, measurements
Hexadecimal160 to 9, A to F0x (or #)Colour codes, memory addresses, byte values, debugging
Base 32 / Base 3632 / 360 to 9, A to ZnoneShort 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
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010
17100012111
18100102212
19100112313
20101002414

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 / 2780
78 / 2390
39 / 2191
19 / 291
9 / 241
4 / 220
2 / 210
1 / 201

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 value11010110
Adds up to128640160420

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
HexBinaryDecimal HexBinaryDecimal
000000810008
100011910019
200102A101010
300113B101111
401004C110012
501015D110113
601106E111014
701117F111115

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
7111rwxRead, write and execute
6110rw-Read and write
5101r-xRead and execute
4100r--Read only
0000---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^011Single bit
2^41610One hex digit (a nibble)
2^712880Highest bit of a byte
2^8256100Values in one byte (0 to 255)
2^101,024400One kibibyte
2^1665,5361000016-bit values, TCP and UDP ports
2^201,048,576100000One mebibyte
2^2416,777,2161000000Number of 24-bit RGB colours
2^324,294,967,296100000000IPv4 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
1270111 11117FLargest signed 8-bit value
10000 000101Positive one
00000 000000Zero
-11111 1111FFAll bits set
-21111 1110FEOne less than -1
-1001001 11009CSame bits as unsigned 156
-1281000 000080Smallest signed 8-bit value
Signed integer ranges by bit width
Width Smallest value Largest value
8-bit-128127
16-bit-32,76832,767
32-bit-2,147,483,6482,147,483,647
64-bit-9,223,372,036,854,775,8089,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#0000000, 0, 0
White#FFFFFF255, 255, 255
Red#FF0000255, 0, 0
Green#00FF000, 255, 0
Blue#0000FF0, 0, 255
Orange-red#FF5733255, 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
10000010100APrivate 10.x.x.x network
1281000000080First bit of a mask
16810101000A8192.168.x.x home networks
17210101100ACPrivate 172.16 to 172.31 range
19211000000C0192.168.x.x home networks
25511111111FFFull 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
Space320010000020
0480011000030
A650100000141
a970110000161

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.

  1. 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.
  2. Choose the input base: Select Binary, Octal, Decimal, Hex or Custom, and pick a base from 2 to 36 for Custom.
  3. Read all bases at once: The Binary, Octal, Decimal and Hexadecimal rows appear together, plus an extra base you choose.
  4. Tune the display: Turn digit grouping, prefixes and uppercase letters on or off to match how you will use the result.
  5. Check the bit view and stats: See each bit, the bit length, set bits, bytes needed and the Unicode character.
  6. Check two's complement: Pick 8, 16, 32 or 64 bits to see how a negative or positive value is stored.
  7. 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.

Worked Example: Convert 156 to Binary, Octal and Hex

The decimal number 156 is 10011100 in binary, 234 in octal and 9C in hexadecimal. You can check it by place value: 128 + 16 + 8 + 4 = 156 in binary, 2 × 64 + 3 × 8 + 4 = 156 in octal, and 9 × 16 + 12 = 156 in hex, where C stands for 12. Type 156 into the converter above with the input base set to 10 and you will see all three results together with the bit view.

Prefixes in Code: 0x, 0b and 0o

Programmers mark the base of a number with a prefix. In JavaScript and Python, 0x means hexadecimal, 0b means binary and 0o means octal, so 0xFF is 255. C and older languages often write octal numbers with only a leading zero, which is a common source of bugs. The converter accepts these prefixes, so you can paste a value straight from your code. If you also work with text or links, the QR code generator can encode them into a scannable code.

Tips for Students Learning Number Systems

  • Learn the powers of 2: Knowing 1, 2, 4, 8, 16, 32, 64, 128 and 256 makes binary conversion much faster.
  • Group bits in fours: Each group of four bits is exactly one hex digit.
  • Group bits in threes: Each group of three bits is exactly one octal digit.
  • Check your answer backwards: Convert the result back to decimal and compare.
  • Use the tool to verify homework: Do the conversion by hand first, then compare with the converter. If you also need to write numbers in words, use the number to words converter.

Troubleshooting: Common Number Base Converter Problems

  • The converter says a digit is invalid: Every digit must be smaller than the base. The digit 2 is not valid in binary, and the letter G is not valid in hex.
  • Hex letters are not accepted: Letters A to F work in base 16 and above. Make sure the input base is set correctly.
  • Negative numbers look different from your textbook: Two's complement depends on the number of bits you choose.
  • The result is very long: Large numbers need many bits. The converter supports huge values, so long output is expected.

Is It Safe to Use an Online Number Base Converter?

Yes. All conversions run in your browser, so the numbers you type are not uploaded or saved, and no account is needed.

More Free Tools You May Need

A number base converter is often one step in a bigger everyday task. These related free tools make the rest of the job easier. You can also browse every calculator and converter in the Utility Tools category or open the full list of free tools.

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.

ADVERTISEMENT
Demo Ad 300 x 250 300 x 250
COMMON QUESTIONS

Number Base Converter FAQ

Quick answers about converting binary, decimal, hex and octal, two's complement, large numbers and custom bases.

How do I convert decimal to binary?

Divide the decimal number by 2 repeatedly and write down each remainder until the quotient is 0. Then read the remainders from the last one to the first. For example, 156 gives the remainders 0, 0, 1, 1, 1, 0, 0, 1, which read bottom to top form 10011100. Or type the number into the converter and read the binary result instantly.

How do I convert hexadecimal to decimal?

Multiply each hex digit by 16 raised to its position, counting from 0 on the right, and add the results. Remember that A to F equal 10 to 15. For example, 2F3 equals 2 x 256 + 15 x 16 + 3 = 755. Choose Hex as the input base in the converter to get the decimal value automatically.

How do I convert binary to hexadecimal quickly?

Split the binary number into groups of four bits starting from the right, padding the left with zeros if needed, then replace each group with its hex digit. For example, 1101 0110 becomes D6. This works because one hex digit represents exactly four bits, so no division is needed.

Why do computers use binary, and what are octal and hexadecimal for?

Computer hardware uses two voltage states, so binary (base 2) is the natural way to store and process data. Hexadecimal (base 16) and octal (base 8) are compact shorthand for long binary numbers, because each hex digit equals four bits and each octal digit equals three bits. Decimal (base 10) is simply what people use every day.

How are negative numbers shown in binary (two's complement)?

Most computers store negative integers in two's complement form. To find it, write the positive number in binary using a fixed number of bits, invert every bit and add 1. For example, -100 in 8 bits is 10011100, which is hex 9C. The converter shows the two's complement for 8, 16, 32 and 64 bits.

Can this converter handle very large numbers and bases up to 36?

Yes. It uses arbitrary-precision integers, so very long numbers convert exactly with no rounding, and it supports any base from 2 to 36 using the digits 0-9 and the letters A-Z. It converts whole numbers only, not fractions, and it does not treat Base64 as a number base because Base64 is an encoding.

Is my data safe when I use this number base converter?

Yes. All conversions run in your browser, so the numbers you type are not sent to or saved on our server. The tool is free, needs no signup and works offline once the page has loaded, which makes it safe for homework, programming and networking work.

ADVERTISEMENT
Demo Ad 728 x 90 320 x 100