Skip to content
Calc Engines

Base Converter

Binary to decimal converter: convert numbers between binary, decimal, hexadecimal and octal at once, with bitwise operations.

  • #binary to decimal converter
  • #decimal to binary
  • #hex to decimal
  • #base
  • #hex
  • #binary
  • #octal
  • #decimal
  • #convert
100% client-side

Runs in your browser. Your data never leaves this device.

The Workbench
Base Converter — workspaceLive
Decimal
Hexadecimal
0x
Binary
0b
Octal
0o
1514131211109876543210
Network requests0
Bytes uploaded0
Trackers fired0
The Guide

About Base Converter

/01 What a number base converter does

A number base converter takes one number and shows it in every base at once. Type 255 in decimal and instantly see FF in hexadecimal, 11111111 in binary, and 377 in octal. Change any field and the others follow, so it works in whatever direction you need: decimal to binary, hex to decimal, binary to hex, or anything in between.

Each base is just a different way of writing the same quantity. The number does not change, only its notation. Decimal uses ten symbols because we have ten fingers. Binary uses two because a computer bit has two states. Hexadecimal uses sixteen because two hex digits cover exactly one byte. Octal uses eight, and survives today mainly in one place: file permissions.

If you move between a debugger, a colour value, and a permission mask in the same afternoon, this tool saves you the constant mental gear-changing. Every field updates live, so you can watch how a value rewrites itself as you nudge it.

/02 Where each base shows up in real work

Hexadecimal is everywhere bytes are. Colour codes like FF5733 are three hex bytes: FF for red, 57 for green, 33 for blue, each one a number from 0 to 255. Memory addresses, character encodings, and network MAC addresses are all hex, because two digits per byte is compact and unambiguous.

Binary is where flags and bitwise operations make sense. A permission mask like 111 101 101 reads directly as read, write, and execute bits for user, group, and everyone else. When a piece of documentation says a setting is controlled by bit 5, you want to see that bit as part of the whole number, which binary gives you for free.

Octal is the quiet survivor. Unix file permissions still use it: 755 means read, write, execute for the owner and read and execute for everyone else. Each octal digit is exactly three bits, which is why one digit can hold all three permissions for one class of user.

The prefixes matter when you write these values in code. 0x marks hex, 0b marks binary, and 0o or a leading zero marks octal in many languages. A plain leading zero has bitten more than one developer who expected decimal.

/03 Bitwise operations, made visible

The converter also covers the bitwise operations that get applied to these numbers. AND keeps a bit only when both inputs have it. OR sets a bit when either input has it. XOR sets a bit when the inputs differ, which is the operation behind simple checksums and toggling flags. NOT flips every bit. The shifts move the whole pattern left or right, which multiplies or divides by two for each position moved.

Seeing these on a full number in four bases at once makes them far easier to reason about. An AND with a mask shows exactly which bits survive. A left shift shows the bits sliding up through the hex digits as they move.

This is the daily work of permissions, protocol flags, graphics programming, and embedded systems. It is simple arithmetic, but it is arithmetic almost nobody can do reliably in their head past the first few bits, which is exactly why a converter that keeps all four views on screen at once earns its place.

/04 A quick trick for reading binary

Here is a habit that makes binary friendlier. Learn the values of the first eight bit positions: 1, 2, 4, 8, 16, 32, 64, 128. Any byte is just the sum of the positions where the bit is set. 11111111 is all of them added: 255. 1010 1010 is 128 + 32 + 8 + 2: 170 in decimal, AA in hex.

Notice how the hex follows. Each hex digit is exactly four bits, so a byte splits cleanly into two hex digits. 1010 is A, and two of them make AA. That four-bits-per-digit mapping is why programmers prefer hex for byte values: it is binary with the tedious parts folded up.

Once you see that pattern, reading a value like 0xFF stops being a chore and becomes a number you know at a glance. The converter then becomes less a crutch and more a speed check, which is the right place for it.

/05 Binary to decimal conversion, step by step

Each digit in a binary number is worth twice the one to its right: 1, 2, 4, 8, 16, 32 and so on, reading from the right. To convert binary to decimal, add up the values where a 1 appears. For 101000, the ones sit in the 32 and 8 positions, so 101000 in binary is 40 in decimal. For 1101, the ones are in the 8, 4 and 1 positions, giving 13.

Going the other way, decimal to binary, divide by 2 repeatedly and write down the remainders, then read them from bottom to top. 13 divided by 2 is 6 remainder 1, 6 gives 3 remainder 0, 3 gives 1 remainder 1, and 1 gives 0 remainder 1, so 13 is 1101.

This binary to decimal converter does both instantly and shows hexadecimal and octal at the same time, so you can check homework, read a bit mask or translate a colour code without working it through by hand.

FAQ

Questions about Base Converter.

How do I convert decimal to binary and hex?
Type the number into the decimal field and the binary and hexadecimal fields update instantly. It works in every direction: change hex and the decimal and binary views follow, so decimal to hex, hex to binary, and binary to octal all take one step.
Why is hexadecimal used for colours and memory addresses?
Each hex digit represents exactly four bits, so two digits cover one byte precisely — one channel of red, green, or blue from 0 to 255. It is the most compact way to write byte values without any ambiguity.
What do the 0x, 0b, and 0o prefixes mean?
They mark the base in source code: 0x for hexadecimal, 0b for binary, and 0o for octal. Beware that a plain leading zero also means octal in several older languages, which is an easy trap when writing padded numbers.
What does octal 755 mean in file permissions?
Each digit covers one class of user: owner, group, others. 7 is read, write, and execute; 5 is read and execute. So 755 means the owner can do everything and everyone else can read and run, the standard setting for scripts and programs.
Can it handle bitwise operations like AND, OR, and XOR?
Yes. The tool shows AND, OR, XOR, NOT, and bit shifts applied to your value, with the result visible in all four bases so you can see exactly which bits survive each operation.
Does it convert negative or fractional numbers?
It is built for whole numbers, the case that comes up in programming, permissions, and flag work. Those are the values bases and bits are really about.
What is 101000 in binary to decimal?
40. The 1 bits are in the 32 and 8 positions, and 32 + 8 = 40.
Do leading zeros change a binary number?
No. 0011 and 000011 are both 3; leading zeros only pad the number to a fixed width, such as 8 bits for a byte. The value is set by the positions of the 1 bits.
What is 13 in binary?
1101, because 8 + 4 + 1 = 13. In 8-bit form it is written 00001101.
Related