Convert between binary, hexadecimal, decimal, and octal number systems.
| Decimal | Hex | Binary | Octal |
|---|---|---|---|
| 8 | 0x08 | 0000 1000 | 10 |
| 16 | 0x10 | 0001 0000 | 20 |
| 32 | 0x20 | 0010 0000 | 40 |
| 64 | 0x40 | 0100 0000 | 100 |
| 128 | 0x80 | 1000 0000 | 200 |
| 255 | 0xFF | 1111 1111 | 377 |
| 256 | 0x100 | 1 0000 0000 | 400 |
| 65535 | 0xFFFF | 1111 1111 1111 1111 | 177777 |
A number base is a positional numbering method, and positional notation is a system where the value of a digit depends on both the symbol itself and its place in the sequence. In digital systems, number representation refers to the practical choice of binary for hardware, hexadecimal for readability, and decimal for general communication.
Uses digits 0-1. The native language of digital circuits and computers. Each digit represents a power of 2.
Uses digits 0-7. Less common today but still used in some Unix/Linux file permissions.
Uses digits 0-9. The standard human-readable number system we use daily.
Uses 0-9 and A-F. Compact representation of binary data. 1 hex digit = 4 binary bits.
| Base | Symbol Set | Main Advantage | Typical Engineering Use |
|---|---|---|---|
| Binary | 0-1 | Bit-level visibility | Flags, masks, hardware states |
| Decimal | 0-9 | Human familiarity | Reports, calculations, UI display |
| Hexadecimal | 0-9, A-F | Compact binary mapping | Registers, addresses, color values |
| Octal | 0-7 | Three-bit grouping | Legacy interfaces and software contexts |
Multiply each binary digit by its position value (powers of 2) and sum them. For example: 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11
Hex is compact (1 hex digit = 4 bits) and easy to convert to/from binary. It's widely used in programming, memory addressing, and color codes.
0x indicates hexadecimal, 0b indicates binary, and 0o indicates octal. These prefixes help distinguish the number base in code.
Octal is less common in modern electronics than binary or hex, but it still appears in legacy systems and some software contexts where groups of three bits are meaningful.
For firmware or hardware debugging, compare the converted value against the datasheet register map or source code constant so the numeric representation matches the engineering intent.