Developer Guide

Binary, Hex, Decimal and Text, How to Convert Between Number Bases

By Muhammad Waseem Updated 648 words

Computers store everything, numbers, letters, images, as bits, and engineers wrote those bits in shorter forms to make them readable. Binary, base 2, hexadecimal, base 16, octal, base 8, and the decimal, base 10, we use every day. They are all just different notations for the same value, so converting between them is arithmetic, not magic.

This guide shows how each base works, how to move between them by hand and with the free Binary Calculator and Hex Calculator, and why turning a run of bytes into text needs a character encoding, the distinction the Binary to Text and Hex to Text tools handle for you.

One number, four ways to write it

A base tells you how many symbols each digit can hold and what each column is worth. Decimal has ten digits and columns of tens. Binary has two digits and columns of twos. Hex has sixteen and columns of sixteens. The value does not change, only the notation.

Take the number 72. In decimal it is seven tens and two ones. In binary it is 01001000, 64 plus 8. In hex it is 48, four sixteens and eight. Same quantity, three costumes.

BaseDigits usedCommon prefixWhere you meet it
Binary, 20, 10bRaw bits, flags, networking
Decimal, 100-9noneEveryday maths, form inputs
Hexadecimal, 160-9, A-F0xColors, memory addresses, byte dumps
Octal (8)0-70oUnix file permissions

Hex is popular for bytes because one hex digit is exactly four bits, so a byte is always two hex characters, far shorter than eight binary digits and easier to eyeball.

Converting by hand, the fast way

To turn decimal into binary, keep dividing by 2 and read the remainders bottom-up. The calculator does it instantly. To read binary, add the column weights. Each 1 contributes 1, 2, 4, 8, 16 and so on.

Binary to hex is pure grouping. Split the bits into groups of four from the right and map each group to one hex digit, 1111 = F. Hex to binary is the reverse, expand each digit back to four bits. Decimal to hex needs repeated division by 16.

From bytes to text, why a converter is not a calculator

A number and a character only look similar, they are different questions. 01001000 as a number is 72, but as a byte it is the letter H under ASCII, and the same byte also means H in UTF-8. Converting binary or hex to text means interpreting each byte through a character encoding.

This is where people slip. Plain ASCII covers 0-127, so anything above that, accents, emoji, most non-Latin scripts, belongs to UTF-8, which uses multiple bytes per character. Feeding UTF-8 bytes to a strict ASCII decoder yields gibberish, which is why the tools state they assume a UTF-8 byte order for values above 127.

Getting it right first time

Use underscores or spaces to group long bit strings so you do not miscount, keep the prefix, 0b, 0x, consistent so the converter reads the base correctly, and remember that negative numbers in computing use two\x27s-complement internally, which is a different job from simple base conversion.

For everyday work, pick the tool that matches the question. A base calculator for numeric values, and a binary-to-text or hex-to-text converter when you want the characters those bytes represent.

Frequently Asked Questions

Is 0x48 the same as 72?

Yes, numerically. 0x48 is hexadecimal for 4 sixteen plus 8, which is 72 in decimal, and 72 is 01001000 in binary. They are three notations for one number.

Why does my binary-to-text output show H instead of 72?

Because you asked for the character, not the number. The byte 01001000 equals 72, and 72 is the ASCII code for the letter H, so a text decoder prints H while a calculator prints 72.

Can I convert hex to binary in my head?

Yes. Each hex digit maps to exactly four bits, so 0xF3 is 1111, F, then 0011, 3, = 11110011. No long division needed.

What about letters above Z or emoji?

Those are outside single-byte ASCII. In UTF-8 they use two or more bytes, so a naive one-byte-per-character decoder will garble them. Use UTF-8 aware conversion for real text.

Do these tools upload my input?

No. Base conversion and byte decoding are pure arithmetic that runs in your browser, so nothing is sent anywhere.

Related guides

Browse all 57 guides

Recognised & listed on