Binary Converter
Convert numbers between binary (base 2), decimal (base 10), octal (base 8), and hexadecimal (base 16) instantly. Also convert ASCII text to binary and back.
What is a Binary Converter?
A binary converter translates numbers between positional numeral systems with different bases — most commonly between decimal (base 10, the everyday number system using digits 0–9), binary (base 2, using only 0 and 1), hexadecimal (base 16, using digits 0–9 and letters A–F), and octal (base 8, using digits 0–7). All modern digital computers store and process data exclusively in binary, making conversions between these systems essential for programming, computer science, electronics, and network engineering.
In binary, each digit position represents a power of 2, reading right to left: 2⁰=1, 2¹=2, 2²=4, 2³=8, and so on. The decimal number 13 is represented as 1101 in binary (8+4+0+1). Hexadecimal is a compact shorthand for binary: each hex digit maps exactly to a 4-bit binary group (nibble), making it far more human-readable than long strings of 0s and 1s. For example, the hex colour #FF5733 expands to 24 bits of binary representing red, green, and blue channel values.
Octal (base 8) was historically used in early computing and UNIX file permission notation (e.g. chmod 755). While less common today, understanding octal remains useful for Unix/Linux system administration. This converter handles all four common bases — decimal, binary, hexadecimal, and octal — with instant bidirectional conversion.
How the Binary Converter Works
Formula, assumptions, and calculation steps for this dev tools tool.
Formula Used
Decimal to Binary uses repeated division by 2, reading remainders in reverse
Methodology
Converts between binary, decimal, octal, and hexadecimal using positional base-conversion arithmetic.
Calculation Steps
- Provide the input text or select generation options.
- Apply the selected encoding, parsing, hashing, or formatting rule.
- Validate the output where possible.
- Return copy-ready developer output.
Assumptions and Limits
- Generated or transformed output depends exactly on the supplied input.
- Security-sensitive values should be handled carefully.
- Browser tools do not replace production validation.
Frequently Asked Questions
Repeatedly divide the decimal number by 2 and record the remainder (0 or 1) each time. Read the remainders from bottom to top to get the binary representation. For example, 10 ÷ 2 = 5 R0, 5 ÷ 2 = 2 R1, 2 ÷ 2 = 1 R0, 1 ÷ 2 = 0 R1. Reading up: 1010.
Binary is a base-2 number system that uses only two digits: 0 and 1. Each digit is called a bit (binary digit). Groups of 8 bits form a byte. Binary is the foundation of all digital computing because electronic circuits naturally represent two states: off (0) and on (1).
Every piece of data in a computer — text, images, video, programs — is ultimately stored and processed as binary. Processors execute machine code in binary, memory stores bits in billions of tiny transistors, and all arithmetic is performed with binary logic gates (AND, OR, NOT, XOR).
Two's complement is the most common way to represent negative integers in binary. To negate a number: invert all bits (one's complement) then add 1. For example, +5 in 8-bit is 00000101. Inverted: 11111010. +1 = 11111011, which is -5. This makes binary arithmetic consistent for both positive and negative numbers.
Real-World Applications
Common Mistakes
Number Base Quick Reference
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
References
- Knuth, D. E. The Art of Computer Programming, Vol. 2: Seminumerical Algorithms. Addison-Wesley, 1997.
- Patterson, D. A. & Hennessy, J. L. Computer Organization and Design. Morgan Kaufmann, 2020.
- IEEE Std 754-2019. IEEE Standard for Floating-Point Arithmetic. IEEE, 2019.
- RFC 4632. Classless Inter-domain Routing (CIDR). IETF, 2006.
- Linux man-pages. chmod(2) — change permissions of a file. kernel.org.
Related Calculators
Browse all Dev Tools calculators →Hex Converter
Convert between hexadecimal, decimal, binary, and text (ASCII/UTF-8).
Color Converter
Convert colors between HEX, RGB, HSL, HSV, CMYK, and CSS formats.
Scientific Notation Calculator
Convert numbers to and from scientific notation and perform arithmetic in scientific notation.