Number System Converter
Free online number system converter. Convert between binary, decimal, hexadecimal, and octal in any direction with instant results. Built for programmers, students, and engineers.
Conversion Settings
No value entered
Conversion Result
Conversion result will appear here
Enter a value and click "Convert" to start
About Number System Converter
The Number System Converter is a complete tool for translating numbers between the four most widely used positional number systems in computing — binary (base-2), decimal (base-10), hexadecimal (base-16), and octal (base-8). Enter any value, choose the source and target base, and get the exact converted output instantly. Every direction works: binary to decimal, decimal to binary, binary to hex, hex to binary, binary to octal, octal to binary, decimal to hex, hex to decimal, decimal to octal, octal to decimal, hex to octal, and octal to hex. Whether you are debugging memory addresses, working with bitmasks, computing chmod permissions, decoding HTML color codes, or studying digital logic in school, this converter handles the math correctly the first time. Inputs are validated for each base (only 0–1 for binary, 0–9 for decimal, 0–9/A–F for hex, 0–7 for octal), so invalid characters never silently corrupt the result. The tool runs entirely in your browser — no data leaves your device, no signup, no rate limit, no ads injected into the result.
Why use a Number System Converter?
Manual base conversion is mechanical work that is easy to get wrong. A single bit flipped during a binary-to-hex conversion can break a CIDR mask, corrupt a color, or change a permission bit. This converter eliminates that risk: it parses your input strictly, converts through a canonical decimal pivot, and prints the exact result with the correct casing for hex. The four-way matrix means you do not need a separate tool for each direction — one URL bookmark covers binary↔decimal, binary↔hex, binary↔octal, decimal↔hex, decimal↔octal, and hex↔octal. The result is one click to copy and one click to download as a text file with full conversion metadata. There are no character or value limits beyond what JavaScript number representation supports, so converting a 32-bit IP mask, a 64-bit hash prefix, or a multi-byte sequence works the same way.
Who is it for?
Software engineers working with bitwise operators, flags, and packed structs. Network engineers translating subnet masks between dotted-decimal and binary. Systems administrators reading or writing chmod-style octal Unix permissions. Embedded firmware developers reading datasheets that mix hex and binary. Front-end developers checking hex color values against their RGB equivalents. Reverse engineers and CTF players decoding memory dumps. Computer science students learning number systems, two's complement, and digital logic for the first time. Anyone preparing for technical interviews where binary, hex, and octal questions are common.
Number Systems Explained
Binary (base-2)
Digits: 0, 1
Binary is the native language of digital computers: every value is represented using only two digits, 0 and 1, where each position represents a power of two. The rightmost bit is 2^0 (1), the next is 2^1 (2), then 2^2 (4), 2^3 (8), and so on. An 8-bit byte can hold any value from 00000000 (0) to 11111111 (255). Binary maps directly to the on/off state of transistors and the logical operations AND, OR, XOR, and NOT, which is why every higher-level number system in computing ultimately reduces to it.
- •Bit-level CPU operations and bitmasks
- •Network subnet masks and CIDR notation
- •File permission bits and feature flags
- •Digital logic gates and circuit design
- •Low-level firmware and assembly programming
Decimal (base-10)
Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Decimal is the everyday human number system, using ten digits (0–9) and place values that are powers of ten. While computers do not natively store decimal, all input from users typically arrives as decimal text and must be parsed into binary before processing. Conversions between decimal and the computer-native bases (binary, hex, octal) are the most common use case for this tool, especially when reading numeric values out of code, configuration files, or hardware datasheets.
- •Reading and writing numbers in source code
- •Translating IPv4 octets in dotted-decimal form
- •Configuration values, ports, timeouts, and limits
- •Mathematical and statistical calculations
- •User-facing output of any numeric quantity
Hexadecimal (base-16)
Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Hexadecimal uses sixteen distinct digits (0–9 and A–F) where A=10, B=11, C=12, D=13, E=14, F=15. Its key advantage is that each hex digit maps to exactly four binary bits, so a byte fits in exactly two hex characters and a 32-bit word fits in eight. This makes hex the standard format for memory addresses, machine code, hashes, MAC addresses, and CSS color codes. Reading a long binary string is error-prone for humans; the same value in hex is typically four times shorter and easier to scan.
- •Memory addresses and pointer values in debuggers
- •CSS and HTML color codes (#RRGGBB)
- •MAC addresses and unique device identifiers
- •Cryptographic hash digests (SHA-256, MD5)
- •Binary file dumps and hex editors
Octal (base-8)
Digits: 0, 1, 2, 3, 4, 5, 6, 7
Octal uses eight digits (0–7), with each octal digit representing three binary bits. Once dominant in early computing, octal is now mostly seen in two places: Unix file permissions (chmod 755, 644) where each octal digit packs the read/write/execute bits for owner/group/other, and certain legacy systems and embedded environments. Many programming languages let you write octal literals using a leading 0 (e.g., 0755 in C) or 0o (0o755 in modern JavaScript and Python).
- •Unix and Linux file permissions (chmod)
- •Legacy mainframe and embedded systems
- •Some hardware register documentation
- •Octal escape sequences in strings
- •Compact representation of 3-bit grouped data
How to use the tool
Enter the value you want to convert in the input field
Select the source number system from the 'From' dropdown (binary, decimal, hexadecimal, or octal)
Select the target number system from the 'To' dropdown
Click the Convert button to compute the result
Use the Swap button to flip the conversion direction without re-typing
Copy the result to clipboard or download it as a .txt file with full conversion metadata
Worked Conversion Examples
Convert 13 (decimal) to binary
- 1Divide 13 by 2: 6 remainder 1
- 2Divide 6 by 2: 3 remainder 0
- 3Divide 3 by 2: 1 remainder 1
- 4Divide 1 by 2: 0 remainder 1
- 5Read the remainders from bottom to top
1101Convert 1011 0110 (binary) to hex using 4-bit grouping
- 1Split the binary into 4-bit nibbles from the right: 1011 and 0110
- 2Convert each nibble to its hex digit independently
- 31011 = 8+0+2+1 = 11 = B
- 40110 = 0+4+2+0 = 6
- 5Concatenate the hex digits in the original order
B6Convert 755 (octal) to chmod permission bits
- 1Split the octal value digit by digit: 7, 5, 5
- 2Convert each digit to 3 binary bits: 7=111, 5=101, 5=101
- 3Group as owner/group/other: 111 (rwx), 101 (r-x), 101 (r-x)
- 4Translate r=read, w=write, x=execute
rwxr-xr-xConvert FF (hex) to decimal
- 1Identify each hex digit's value: F = 15, F = 15
- 2Multiply each by its place value: 15 × 16^1 = 240, 15 × 16^0 = 15
- 3Sum the products: 240 + 15
255Convert 192 (decimal) to binary for an IPv4 octet
- 1Find the largest power of two that fits in 192: 128 (2^7)
- 2Subtract: 192 − 128 = 64; the next bit is 64 (2^6)
- 3Subtract: 64 − 64 = 0; remaining bits are zero
- 4Pad to 8 bits for an IPv4 octet
11000000Convert 1A (hex) to octal via decimal pivot
- 1Hex 1A = 1×16 + 10 = 26 in decimal
- 2Divide 26 by 8: 3 remainder 2
- 3Divide 3 by 8: 0 remainder 3
- 4Read remainders bottom to top
32Key Features
Four supported bases
Binary, decimal, hexadecimal, and octal — every direction between any pair works in one click.
Strict input validation
Each base accepts only its valid digit set; invalid characters trigger a clear error before any conversion runs.
Direction swap
The Swap button instantly flips the source and target bases and copies the previous output back to the input.
Copy and download
Copy the result to your clipboard or download a .txt file with full input/output metadata for documentation.
Privacy-first execution
All conversion happens locally in your browser. No telemetry, no logging of input values, no third-party analytics on the conversion result.
Common Use Cases
Bitwise operations and flag packing
Scenario: You need to set or check a specific bit inside a packed integer flag, for example combining permission flags or hardware register bits.
✓ Convert decimal flag values to binary to see exactly which bits are set, then back to decimal or hex for use in code.
IPv4 subnet masks and CIDR
Scenario: You are reading a CIDR notation like /24 and need to translate it to a dotted-decimal subnet mask, or convert 255.255.255.0 to binary to count the prefix length.
✓ Each octet converts independently between decimal and 8-bit binary, making it trivial to count the leading 1-bits and validate masks.
Unix file permissions (chmod)
Scenario: You see chmod 755 in a Dockerfile or shell script and want to know exactly which read/write/execute bits are granted, or you have a permission string and need the octal equivalent.
✓ Each octal digit maps directly to three permission bits, so the converter shows the bit pattern instantly.
CSS and HTML color codes
Scenario: You have a hex color like #1A2B3C and need its component RGB values for a JavaScript animation or canvas API call.
✓ Convert each pair of hex digits to decimal independently to get the red, green, and blue channel values.
Memory addresses in debuggers
Scenario: A crash log shows a hex memory address like 0x7FFE3A2C and you need to compare it to a decimal offset from a different tool.
✓ Hex-to-decimal conversion lines up addresses across tools that print in different bases.
ASCII and Unicode code points
Scenario: You need to translate a hex Unicode code point (U+0041) to its decimal value (65) to use in a numeric character reference like A.
✓ Hex-to-decimal conversion gives the exact code point value for use in HTML entities or programming language escape sequences.
Why Choose This Tool
- Four-way conversion matrix in a single tool — binary, decimal, hexadecimal, and octal
- Strict input validation per base prevents silent data corruption
- Runs entirely client-side; no value is sent to a server
- One-click swap to reverse the conversion direction without re-entering data
- No ads, no signups, no rate limits, no character cap beyond JavaScript number range
Frequently Asked Questions
What does this mean: 01001000 01100101 01101100 01101100 01101111 00100001?
That binary string spells the text "Hello!" — split into 6 bytes of 8 bits each, where every byte represents one ASCII character. 01001000 = 72 = H, 01100101 = 101 = e, 01101100 = 108 = l (twice), 01101111 = 111 = o, and 00100001 = 33 = ! (the exclamation mark). To decode any binary message, group the digits into bytes of 8, convert each byte to its decimal ASCII code, then look up the corresponding character.
How do I say "hi" in binary?
The word "hi" in binary is 01101000 01101001. Each character converts to its 8-bit ASCII representation: h = 104 = 01101000, and i = 105 = 01101001. To express any text in binary, look up each letter's ASCII decimal value (lowercase letters start at 97 for 'a', uppercase at 65 for 'A'), then convert each decimal value to 8-bit binary. Use this tool with "From: Decimal" and "To: Binary" selected for the per-character conversion.
How to convert the binary?
To convert binary to decimal, multiply each bit by its place value (powers of 2 from right to left) and sum the results. For example, 1101 = 1×8 + 1×4 + 0×2 + 1×1 = 13. To convert decimal to binary, repeatedly divide the number by 2 and read the remainders from bottom to top: 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1, giving 1101. This converter performs both directions automatically — enter the value, choose source and target base, and click Convert.
What is 777 in binary code?
The number 777 has two common interpretations in computing. As a decimal number, 777 in binary is 1100001001 (10 bits, produced by dividing 777 by 2 repeatedly and reading the remainders). However, 777 is most often seen as a Unix file permission code written in octal, where each digit represents 3 permission bits: 7 = 111 (read, write, execute). So chmod 777 expands in binary to 111 111 111, granting full read, write, and execute access to the owner, group, and others — the most permissive (and least secure) file permission setting in Unix and Linux systems.
What is the largest number this converter can handle?
The tool uses standard JavaScript number parsing, which is reliable up to 2^53 − 1 (about 9 quadrillion in decimal, or 53 bits of binary). For most practical conversions — IP addresses, color codes, file permissions, memory addresses up to 53 bits — it works without precision loss.
Why does my hex output appear in uppercase?
The tool emits uppercase hex (A–F) by convention to match how hex is most commonly written in datasheets, hashes, and color codes. CSS and most languages accept either case, so you can copy the output directly and lowercase it if your style guide requires.
Can I convert negative numbers?
The tool currently handles non-negative integers. To represent a negative value in binary, programmers typically use two's complement, which requires choosing a fixed bit width (8, 16, 32, or 64 bits). For unsigned conversions across all four bases, use this tool directly; for signed two's complement work, choose the bit width first and then convert the unsigned representation.
Why are there no spaces between bits in the binary output?
Binary output is emitted as a contiguous string so it can be copied directly into source code, configuration files, or shell scripts that expect a raw token. To group bits visually for readability, you can manually space them in groups of 4 or 8 after copying.
Does this tool handle floating point or fractional numbers?
No. The converter is designed for integer values only, which is the dominant use case for binary, hex, and octal in programming. Fractional binary representation (IEEE 754) is a different problem requiring tooling that exposes mantissa, exponent, and sign components separately.
Why is octal still used for chmod when hex is more common elsewhere?
Unix file permissions consist of three groups of three permission bits (read/write/execute for owner, group, and other) — exactly nine bits. Octal digits are three bits each, so three octal digits map perfectly to the nine permission bits with one digit per group. Hex would split awkwardly across the group boundaries, while octal reads cleanly: 755 = rwx r-x r-x.
How do I convert binary to hex faster by hand?
Group the binary digits into 4-bit nibbles from the right, then convert each nibble independently to a single hex digit. For example, 1011 0110 splits into 1011 (B) and 0110 (6), giving B6. This works because 16 = 2^4, so every group of 4 bits maps to exactly one hex digit.
Is this tool free and is my input ever stored?
Yes, it is completely free with no signup or rate limit. All conversion happens locally in your browser using standard JavaScript — no input value is sent to any server, logged, or stored. You can verify this in your browser's network inspector while using the tool.
Related Tools
Share This Tool
Found this tool helpful? Share it with others who might benefit from it!
💡 Help others discover useful tools! Sharing helps us keep these tools free and accessible to everyone.