🔢 Number Base Converter
Convert between binary/octal/decimal/hexadecimal
Related Calculators
Number Base Converter Guide
The Number Base Converter supports conversion between four commonly used number bases: binary (BIN), octal (OCT), decimal (DEC), and hexadecimal (HEX). Select the input base type and enter a value, and the tool simultaneously displays the representation in all four bases.
A number base (or numeral system) is a fundamental concept of counting systems. In daily life we use decimal (base 10), while computers internally use binary (base 2). Programmers frequently need to convert between hexadecimal (memory addresses, color codes) and binary/decimal. This tool is a helpful assistant for learning computer fundamentals and everyday programming work.
Core Rules of Four Number Bases
【Binary BIN】Characters: 0,1 Base=2 Example: 1010(binary) = 10(decimal) Uses: Computer low-level operations, bit manipulation, network masks 【Octal OCT】Characters: 0-7 Base=8 Example: 12(octal) = 10(decimal) Uses: Linux file permissions (rwx=7), legacy Unix systems 【Decimal DEC】Characters: 0-9 Base=10 Example: 10 → Everyday counting system 【Hexadecimal HEX】Characters: 0-9,A-F Base=16 Example: A(hex)=10(dec), FF(hex)=255(dec) Uses: Color codes (#FF5733), memory addresses, extended ASCII
Practical Examples
Important Notes
Application Scenarios
- - Software development: Viewing variable values in hexadecimal/binary during debugging
- - Web frontend: CSS color values (#RRGGBB) and RGB component conversion
- - Network engineering: Binary analysis of subnet masks (255.255.255.0)
- - Embedded development: Register configuration, bit field operations, port address settings
- - Computer science education: Understanding how data is stored in computers
Why Computers Use Binary
Binary became the foundation of computing because it is the easiest to implement with physical devices — high voltage represents 1, low voltage represents 0 (or vice versa). The on/off state of transistors naturally corresponds to one bit of binary. Although multi-valued logic (such as ternary) is theoretically possible, two-state devices are the most stable and reliable.
Interesting fact: Octal and hexadecimal are essentially "shorthand" representations of binary numbers — every 3 binary digits correspond to 1 octal digit, and every 4 binary digits correspond to 1 hexadecimal digit. This is why they are both powers of 2 (2³=8, 2⁴=16), allowing perfect conversion to and from binary without precision loss.