Back to home Developer Number Base Converter

Number Base Converter

Convert between binary, octal, decimal and hex

How to use Number Base Converter

Convert numbers between binary, octal, decimal and hexadecimal. Instant conversion. Free online number base converter tool.

What are number base conversions used for?

Computers operate in binary (base 2), but humans work in decimal (base 10). Hexadecimal (base 16) bridges the gap — compact enough for human reading, directly mappable to binary. Understanding all four bases is fundamental to computer science and electronics.

Quick reference: Binary uses 0,1. Octal uses 0-7. Decimal uses 0-9. Hexadecimal uses 0-9 and A-F (A=10, B=11, C=12, D=13, E=14, F=15).

Frequently Asked Questions

Why do computers use binary?

Electronic circuits have two stable states — on (1) and off (0). Binary maps perfectly to these two states. Transistors, the building blocks of processors, switch between on and off, making binary the natural language of digital hardware. All other number bases used in computing (hex, octal) are convenient abstractions over underlying binary.

How do I convert binary to hexadecimal?

Group the binary digits into groups of 4 from the right, then convert each group to its hex digit. 11110101 → 1111=F, 0101=5 → F5. This works because 16=2^4 — one hex digit always represents exactly 4 binary digits. This is why hex is preferred over decimal for binary data representation.

What is two's complement?

Two's complement is how computers represent negative integers in binary. To negate a number: flip all bits and add 1. For example, in 8-bit: 5 = 00000101; -5 = 11111010 + 1 = 11111011. This encoding allows the same hardware circuitry to perform both addition and subtraction.

What does 0x mean before a number?

0x is the conventional prefix indicating a hexadecimal number in programming languages. 0xFF means hex FF = decimal 255. Similarly, 0b prefix indicates binary (0b11111111 = 255) and 0o or 0 prefix indicates octal. Without a prefix, numbers are assumed to be decimal.

How many hex digits do I need to represent a 32-bit number?

32 bits ÷ 4 bits per hex digit = 8 hex digits. A 32-bit color value like 0x7B35F5FF uses all 8 digits (RRGGBBAA). An IPv4 address also fits in 32 bits = 8 hex digits. A 64-bit value needs 16 hex digits.

Binary vs octal vs decimal vs hexadecimal — when to use each

Binary is the native computer language — used for bitwise operations, understanding hardware, and protocol fields. Octal is mainly used for Unix file permissions (chmod) and some legacy systems. Decimal is for human communication — prices, counts, and everyday numbers. Hexadecimal is the working format for developers — compact binary representation used for colors, memory addresses, hash values, and byte-level data inspection.

☕ Buy me a coffee