Number Base Converter
Convert numbers between binary, octal, decimal and hex.
Convert a number between the four bases developers use most: binary, octal, decimal and hexadecimal. Enter a value in any base and see all the others update live, so a hexadecimal colour code, a binary flag or an octal permission becomes readable in the base you actually think in. Students learning computer science meet these conversions constantly, and professionals in programming, networking and digital electronics need them in real work, not just in exams. Doing the conversion by hand is slow and error-prone, especially for long values. Here you get all four results at once, checked against each other. It runs entirely in your browser, with no signup and nothing uploaded.
Why programmers use other bases
Decimal is convenient for people and awkward for machines. Binary reflects how hardware actually stores values, and hexadecimal is a compact way of writing binary, because each hex digit maps exactly to four bits. That is why memory addresses, colour codes and permission flags are written in hex: it is far shorter than binary and converts back to it without any arithmetic.
Where each one shows up
- Binary: bit flags, permissions, and anything working at the level of individual bits.
- Octal: Unix file permissions, which is why chmod 755 has three digits.
- Decimal: everything a person reads.
- Hexadecimal: colour codes, memory addresses, byte values and hashes.
Reading the notation
Prefixes tell you which base a number is written in, and mixing them up produces confusing bugs. 0b marks binary, 0o marks octal, and 0x marks hexadecimal. Without a prefix, 10 is ten in decimal, two in binary, eight in octal and sixteen in hex, so the same characters mean four different values. When a number appears in configuration or code, check the prefix before assuming.
How to use Number Base Converter
- 1
Enter a number in any base.
- 2
See it converted to the other bases.
- 3
Copy the value you need.
Frequently asked questions
Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16).