Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal instantly, with live conversion as you type. Free, no sign-up required.
Last updated:
Was this tool useful?
Use the tool above and you can rate it here.
Number systems in computing
Computers store and process everything as binary (base 2). But reading long strings of 1s and 0s is error-prone for humans, so we use more compact representations: octal (base 8) and hexadecimal (base 16). Each hex digit maps to exactly 4 binary bits, making the conversion lossless and mental.
Common uses by base
- Binary — CPU instruction sets, bitmasking, flags, network subnet masks
- Octal — Unix file permissions (chmod), some legacy protocols
- Decimal — Human-readable numbers, port numbers, IP addresses
- Hexadecimal — Memory addresses, color codes, SHA hashes, byte sequences, UUID values
Quick conversion reference
Memorizing a few hex-to-binary pairs makes manual conversion much faster: 0=0000, 1=0001, 4=0100, 8=1000, A=1010, F=1111. Any hex value can be converted to binary by simply substituting each hex digit with its 4-bit binary equivalent.
Common use cases for base conversion
Computer science students use base conversion exercises to understand digital logic and low-level programming. Embedded systems engineers convert between hex and binary when reading datasheet register maps — microcontroller registers are described in hex addresses but manipulated with bitwise operations on binary values. Network engineers convert IP addresses between decimal and binary to understand subnetting and CIDR notation. Security professionals decode hex-encoded payloads and shellcode during malware analysis.
Powers of 2 — the key to base conversions
All base conversions to and from binary hinge on powers of 2. Memorising the first 16 powers is invaluable: 2^0=1, 2^1=2, 2^2=4, 2^3=8, 2^4=16, 2^5=32, 2^6=64, 2^7=128, 2^8=256, 2^9=512, 2^10=1024, 2^16=65536, 2^32=4,294,967,296. These numbers appear constantly in computing — memory sizes (256 MB, 1 KB = 1024 bytes), port numbers, colour channel values (0–255), and binary flags.
How to convert manually — step by step
To convert decimal to binary: repeatedly divide by 2 and record the remainders from bottom to top. For example, 42 ÷ 2 = 21 R0, 21 ÷ 2 = 10 R1, 10 ÷ 2 = 5 R0, 5 ÷ 2 = 2 R1, 2 ÷ 2 = 1 R0, 1 ÷ 2 = 0 R1 → reading remainders bottom-up: 101010. To convert binary to decimal: multiply each bit by its positional power of 2 and sum. For any other base pair, convert to decimal first, then to the target base.
Frequently asked questions
- What is a number base?
- A number base (or radix) defines how many digits a numeral system uses. Decimal (base 10) uses 0–9. Binary (base 2) uses 0 and 1. Octal (base 8) uses 0–7. Hexadecimal (base 16) uses 0–9 and A–F.
- Why do programmers use hexadecimal?
- Hex is compact and maps neatly to binary: each hex digit represents exactly 4 binary bits (a nibble). This makes it easy to read memory addresses, color codes (#FF5733), file signatures, and bytecode without long binary strings.
- How do I convert binary to decimal?
- Multiply each bit by its positional value (powers of 2 from right to left) and sum the results. For example, 1010 in binary = 1×8 + 0×4 + 1×2 + 0×1 = 10 in decimal. This converter does it instantly for any base.
- What is octal used for?
- Octal was widely used in early computing and is still used in Unix/Linux file permission notation (e.g., chmod 755). Each octal digit represents exactly 3 bits, making it a compact alternative to binary.
- What is the nibble grouping in binary?
- Nibble grouping splits binary output into groups of 4 bits (e.g., 1010 1101 instead of 10101101). This matches hex digit boundaries, making it easier to convert mentally between binary and hexadecimal.
From the blog
Related tools
- JWT Decoder Online — Free, Tokens Stay in Your Browser
Decode any JWT instantly — inspect the header, payload claims, and expiry with human-readable timestamps. 100% client-side; tokens never leave your browser.
- UUID v4 Generator Online — Free, Bulk Up to 50
Generate cryptographically secure UUID v4 values online, up to 50 at once, with uppercase and no-hyphen options. Free, and it runs in your browser.
- CSS Gradient Generator
Build linear and radial CSS gradients visually with a live preview, then copy ready-to-use CSS code for any project. Free, no sign-up needed.
- JSON to CSV Converter Online — Free, No Upload
Convert JSON to CSV in your browser — paste a JSON array, flatten the fields, copy or download the CSV. Free, instant, and nothing leaves your device.
- Diff Checker Online — Compare Text Free, No Upload
Compare two texts or code snippets side by side online and see which lines were added, removed or left unchanged. Free, and nothing is uploaded.