Number Base Converter

Convert between binary, octal, decimal, and hexadecimal.

Decimal (10)255
Copy
Binary (2)11111111
Copy
Octal (8)377
Copy
Hexadecimal (16)FF
Copy

What It Does

Type any number in binary, octal, decimal, or hexadecimal and instantly see all four representations update in parallel. Useful for debugging bitfield operations, reading memory dumps, understanding color codes, and studying computer science number systems.

Number System Reference

Common Conversions

Practical Tips

Frequently Asked Questions

How do I convert a decimal number to binary?
Repeatedly divide the decimal number by 2 and record the remainders from bottom to top. For example, 13 ÷ 2 = 6 R1, 6 ÷ 2 = 3 R0, 3 ÷ 2 = 1 R1, 1 ÷ 2 = 0 R1 — reading remainders upward gives 1101₂. This tool does the conversion instantly for any value.
Why is hexadecimal used in programming?
Hexadecimal (base 16) is compact and maps cleanly to binary — each hex digit represents exactly 4 binary bits (one nibble). This makes hex ideal for representing memory addresses, color codes (#RRGGBB), byte values, bitfield masks, and hash outputs where binary would be too verbose.
What is the octal number system used for?
Octal (base 8) was popular on older computing architectures and is still used in Unix/Linux file permission modes. The permission string 755 is octal: 7 (rwx owner), 5 (r-x group), 5 (r-x others). Each octal digit maps to exactly 3 binary bits.
How do I represent negative numbers in binary?
Modern computers use two's complement representation for signed integers. To negate a number: flip all bits, then add 1. For example, +5 is 00000101, so -5 in 8-bit two's complement is 11111011. This converter works with unsigned (non-negative) integers.
What do the hex prefixes 0x and 0b mean?
These are language-level prefixes that tell parsers the numeric base. 0x prefix means hexadecimal (e.g. 0xFF = 255), 0b means binary (e.g. 0b1010 = 10), and 0o or a leading 0 means octal in many languages. They have no numeric value — they are purely syntactic.