Math Lab

Base Converter

Numbers & arithmetic

Convert integers between binary, octal, decimal, hex.

Edit any field

Editing one base updates all others live. Digits are validated per base.

Representations

Binary (base 2)1111011
Octal (base 8)173
Decimal (base 10)123
Hex (base 16)7B
Prefixed forms
0b1111011
0o173
123
0x7B

Frequently asked questions

What does the number base converter do?

It converts a number between binary, octal, decimal and hexadecimal in one click. For example, 255 in decimal becomes 11111111 in binary, 377 in octal and FF in hexadecimal. You enter the value in any one base and the other three update live, no submit button needed.

How do I read hexadecimal digits like A, B, C, D, E, F?

After 9, hexadecimal continues with A for 10, B for 11, up to F for 15. So 1A in hex is 1 times 16 plus 10, which is 26 in decimal. The tool accepts both uppercase and lowercase letters, so ff and FF give the same result. Useful while reading colour codes like FF5733.

Why do computer engineers use binary and hexadecimal?

Computers store data as on or off switches, which maps directly to binary 1s and 0s. Hexadecimal is a compact shorthand because four binary digits fit into one hex digit. So an 8-bit byte is written as two hex digits, like FF for 255. That is why MAC addresses, colour codes and memory dumps use hex.

What happens if I enter an invalid character for a base?

Each base only allows certain digits. Binary takes 0 and 1, octal takes 0 to 7, decimal takes 0 to 9, and hex takes 0 to 9 plus A to F. If you type a 9 in the binary box or a G in the hex box, the tool flags it as invalid instead of guessing. Fix the entry and the conversion resumes.

Binary versus hexadecimal: which is easier to work with?

Binary is closer to how machines actually think, but it gets long fast : 255 needs 8 digits. Hexadecimal squeezes the same value into 2 digits and is easier for humans to read and remember. Most engineers debug in hex and only drop to binary when they need bit-level control like flags or masks.

Can I convert negative numbers or decimals between bases?

Negative numbers convert with a minus sign in front: minus 10 in decimal is minus 1010 in binary. For real-world computing, negatives use two's complement, which is a separate mode. Fractional values like 0.5 also convert: 0.5 in decimal is 0.1 in binary. The tool supports both cases, but most exam questions stick to whole numbers.