Number Base Converter
Convert numbers between decimal, binary, octal, and hexadecimal. Instant results as you type.
Number Bases: How Computers Count
Humans count in base 10 (decimal) because we have 10 fingers. Computers count in base 2 (binary) because transistors have two states: on and off. But binary is tedious for humans — 11111111 is easier to read as FF (hexadecimal, base 16) or 255 (decimal).
Hexadecimal (base 16) is everywhere in computing: colour codes (#FF5733), memory addresses, MAC addresses, and Unicode code points. Octal (base 8) appears in Unix file permissions (chmod 755). Binary shows up when working with bitwise operations, network masks, and low-level protocols.
This converter handles any base from 2 to 36. Enter a number in one base, see it instantly in all others. It handles large numbers, negative values, and validates input for the selected base.
Common Number Bases
| Base | Name | Digits Used | Where You See It |
|---|---|---|---|
| 2 | Binary | 0, 1 | Low-level computing, network masks, flags |
| 8 | Octal | 0–7 | Unix file permissions (chmod 755) |
| 10 | Decimal | 0–9 | Everyday numbers, most user interfaces |
| 16 | Hexadecimal | 0–9, A–F | Colours (#FF5733), addresses, UUIDs |
| 32 | Base32 | A–Z, 2–7 | TOTP secrets (2FA authenticator apps) |
| 36 | Base36 | 0–9, A–Z | URL shorteners, compact IDs |
What this means for you: Most developers only need decimal, hexadecimal, and binary. Octal matters for Unix permissions. Base36 is useful for short URL-safe identifiers (toString(36) in JavaScript).
Practical Base Conversion Examples
| Decimal | Binary | Hex | Octal | Context |
|---|---|---|---|---|
| 255 | 11111111 | FF | 377 | Max byte value, RGB channel max |
| 420 | 110100100 | 1A4 | 644 | Unix file permission (rw-r--r--) |
| 493 | 111101101 | 1ED | 755 | Unix file permission (rwxr-xr-x) |
| 65535 | 1111111111111111 | FFFF | 177777 | Max 16-bit unsigned integer |
| 16777215 | 111111111111111111111111 | FFFFFF | 77777777 | White colour (#FFFFFF) |
Quick Conversion Tricks
Hex → Binary (by hand)
Each hex digit maps to exactly 4 binary digits. F = 1111, A = 1010, 0 = 0000. So FF = 11111111, and A3 = 10100011. This is why hex and binary are so closely related.
Powers of 2 to memorise
2⁸ = 256, 2¹⁰ = 1024 (1K), 2¹⁶ = 65536, 2³² = ~4.3 billion. These come up constantly in byte limits, colour depth, integer ranges, and memory addressing.
JavaScript shortcuts
0xFF (hex), 0b11111111 (binary), 0o377 (octal) — all equal 255 in JS. Use parseInt("FF", 16) and (255).toString(16) for conversions in code.
Subnet masks
255.255.255.0 in binary is 11111111.11111111.11111111.00000000 — that's /24 in CIDR notation. Understanding binary makes network masks intuitive.
Related Tools
How to use this tool
Enter a number in the input field
Select the base your number is in (decimal, binary, octal, or hex)
See instant conversions to all four bases
Common uses
- Converting hex colour codes to RGB decimal values
- Understanding Unix file permissions in octal
- Working with binary subnet masks and IP addresses
- Debugging memory addresses and byte values in hex
Share this tool