Binary, decimal, octal and hex converter

Type a number, say which base it is in and see it in binary, decimal, octal and hexadecimal.

Your files stay with you. Your files never leave your browser. This tool runs on your device: nothing is uploaded to our servers, so there is nothing for us to store or see.

How to use it

  1. Type the number.
  2. Pick the base it is written in.
  3. Read the other bases below and copy what you need.

Where it helps

Programming

Check bit masks, flags and colour values while coding.

Computer science

Practise binary and hex conversion for exams.

Networking

Read IP and MAC address parts in binary or hex.

Good to know

  • Stays in your browser

    Numbers you type are worked out on your device and never sent to our servers.

  • Whole numbers only

    Fractions aren't converted; negatives use a leading minus.

  • Clear errors

    An invalid digit for the base is named so you can fix it.

Questions people ask

How do you convert between binary, decimal, octal and hexadecimal?

Type the number and pick the base it's written in, from binary (2) to base 36. The tool shows it in binary, decimal, octal and hexadecimal at once. It uses exact big-integer maths, so even 64-bit or 200-digit values convert with no rounding. Prefixes such as 0x and 0b, spaces and underscores are accepted.

  • 2 to 36 Any base. Pick from the list.
  • BigInt Exact. No rounding.
  • 0x 0b 0o Prefixes. Accepted.
  • 4 Bases shown. Bin, oct, dec, hex.
How do I convert binary to decimal?
Choose Binary (base 2) and type the bits. 1111 1111 is 255 in decimal, FF in hexadecimal and 377 in octal. By hand, each bit from the right is worth 1, 2, 4, 8 and so on, doubling each time; add up the values where the bit is 1 to get the decimal number.
Can it handle very large numbers?
Yes. It uses arbitrary-precision integers, so a 64-bit value or even a 200-digit number converts exactly, with no rounding. Many calculators and spreadsheets lose accuracy past about 15 or 16 digits. That makes this tool safe for IDs, hashes and large counters. Paste the value and every base updates at once.
Does it do fractions or negative numbers?
Negative whole numbers work with a leading minus sign, and the result keeps the sign. Fractions aren't supported; the tool converts whole numbers only. Computers store negatives using two's complement, which this tool doesn't show, so work out bit patterns separately when you need them.
How do I convert decimal to hexadecimal?
Leave the base as Decimal and type the number. 255 becomes FF, 4096 becomes 1000 and 65535 becomes FFFF. By hand, divide by 16 repeatedly and read the remainders from bottom to top, using A to F for 10 to 15. The tool shows the answer in capital letters.
Can I paste values with 0x or 0b prefixes?
Yes. When the base is set to hexadecimal, binary or octal, the prefixes 0x, 0b and 0o are understood and stripped. Spaces and underscores, often used to group digits such as 1111_0000, are ignored. That lets you paste values straight from code without cleaning them up first.
What bases are supported?
Any base from 2 to 36. Binary, octal, decimal and hexadecimal are at the top of the list, and the others follow. Bases above 10 use letters for digits, so base 36 uses 0 to 9 and A to Z. Base 36 is sometimes used for short IDs and URL codes.
Why is hexadecimal used so much?
Each hex digit stands for exactly four bits, so two hex digits make one byte. That makes long binary values much shorter and easier to read. Colours on web pages (#FF6A00), memory addresses, MAC addresses and hashes are all commonly written in hexadecimal. Programmers write them with a 0x prefix.
What is octal used for?
Octal groups bits in threes. Today it's mostly seen in Unix and Linux file permissions, where 755 means read, write and execute for the owner and read and execute for everyone else. Older computers also used octal, and some exam syllabuses still include it. Type 755 in octal to see its binary pattern.
What happens if I type an invalid digit?
The tool names the digit and lists the digits that base allows. For example, typing 2 in binary shows that base 2 uses only 0 and 1. It never guesses, so you won't get a wrong answer from a typo. Check that you chose the right base for your number.
Can I convert a hex colour code to RGB?
You can convert each pair separately: FF is 255, 6A is 106 and 00 is 0, so #FF6A00 is RGB 255, 106, 0. The colour converter tool does this in one step and adds HSL as well. Use this tool when you need the full number in one base.
How do I convert an IP address to binary?
Convert each of the four parts separately. 192.168.1.1 becomes 11000000, 10101000, 00000001 and 00000001. Type each part as a decimal number and read the binary line, adding leading zeros so each part has eight digits. This helps when working out subnet masks. IPv6 addresses are already written in hex.
Is the output in uppercase or lowercase?
Hexadecimal and other letter digits are shown in uppercase, such as FF or 1A3. Most programming languages accept both cases, so you can paste the result directly into code. If your style guide wants lowercase, change the case after copying the value. Most editors can change the case with one shortcut.
Is anything I type stored?
No. Conversion runs entirely in your browser and the numbers never reach our servers. There's no sign-up and nothing is saved after you close the page, so it's safe for values from private code, keys or internal systems that shouldn't leave your machine. Close the tab and nothing remains.
Does it work on a phone?
Yes. Type the number with your phone's keyboard, choose the base from the list and the four results appear below straight away. It works in any mobile browser, which is handy for students revising for exams or engineers checking a value on site. No app or account is needed.
Is the number base converter free?
Yes, it's free with no sign-up and no limit on use. It's one of the free converters from Marketiism, and pairs well with the developer tools such as the colour converter and hash generator. Marketiism makes business software for small Indian businesses. Use it as often as you like.

Want this inside your own account?

Marketiism keeps your invoice numbers, GST reports, UPI payment links and WhatsApp reminders in one place. Leave your details and we'll call to set it up for your business, or start the trial yourself.

Start free trial

We use this only to contact you about Marketiism. No spam.

More Converters and calculators

Number to Words

Write any number in words, in Indian (lakh, crore) or international style, and as rupees for cheques.

Unit Converter

Convert length, weight, area, volume, speed, data, time, pressure, energy and temperature.

Age Calculator

Find your exact age in years, months and days, and when your next birthday comes.

Percentage Calculator

Find X% of a number, what percent one number is of another, percentage change and more.

BMI Calculator

Work out your body mass index with WHO and Asia-Pacific categories and a healthy weight range.

Try it on your own business for two weeks.

14 days free, no card. If you get stuck setting up WhatsApp, we'll get on a call and do it with you.