What This Calculator Does

This converter translates numbers between four number systems: Decimal (base 10), Binary (base 2), Hexadecimal (base 16), and Octal (base 8). Type a value in any field and the other three update instantly. It also includes a separate text-to-binary section that converts ASCII text into its binary byte representation.

Inputs Explained

How It Works

Each number system uses a different base (radix). Conversion involves interpreting the digits according to their positional value in the source base, computing the total value, and then re-expressing it in the target base. For text-to-binary, each character's ASCII code is converted to an 8-bit binary string, and the results are displayed space-separated.

Formulas Used

Decimal to Binary: Repeatedly divide by 2, record remainders (read bottom to top).
Binary to Decimal: Sum of (digit × 2^position) for each bit.
Decimal to Hex: Repeatedly divide by 16, map remainders 10–15 to A–F.
ASCII to Binary: Character → char code (0–127) → 8-bit binary string.

Binary & Hex Converter

Type in any field to convert instantly.


ASCII Text

Step-by-Step Example: Decimal 42 to Binary

Step 1: 42 ÷ 2 = 21 remainder 0

Step 2: 21 ÷ 2 = 10 remainder 1

Step 3: 10 ÷ 2 = 5 remainder 0

Step 4: 5 ÷ 2 = 2 remainder 1

Step 5: 2 ÷ 2 = 1 remainder 0

Step 6: 1 ÷ 2 = 0 remainder 1

Read remainders bottom-to-top: 101010

Hexadecimal: 42 ÷ 16 = 2 remainder 10 (A) → 2A

Octal: 42 ÷ 8 = 5 remainder 2 → 52

Step-by-Step Example: Text "Hi" to Binary

H: ASCII code 72 → binary 01001000

i: ASCII code 105 → binary 01101001

Result: 01001000 01101001

Use Cases

Assumptions and Limitations

Frequently Asked Questions

These are all number systems with different bases. Decimal (base 10) uses digits 0–9 and is the system humans use daily. Binary (base 2) uses only 0 and 1 and is the fundamental language of computers. Hexadecimal (base 16) uses 0–9 and A–F and is a compact way to represent binary data. Octal (base 8) uses 0–7 and was historically important in older computing systems.
Computers use binary because their electronic circuits have two states: on and off, corresponding to 1 and 0. This makes binary the most natural and reliable representation for digital hardware. All data — text, images, video, programs — is ultimately stored and processed as sequences of binary digits (bits) inside the computer.
Read a binary number from right to left. Each position represents a power of 2. The rightmost bit is 2⁰ (= 1), the next is 2¹ (= 2), then 2² (= 4), and so on. Add up the values of all positions that have a 1. For example, binary 101010 = 32 + 8 + 2 = 42 in decimal.
Hexadecimal is widely used in computing because it maps neatly to binary — each hex digit represents exactly 4 bits. Common uses include color codes in web design (e.g., #FF0000 for red), memory addresses in debugging, MAC addresses in networking, and raw data inspection in hex editors.
Each text character has a numeric code in the ASCII standard. The letter 'A' is 65, 'a' is 97, '0' is 48, and a space is 32. To convert text to binary, find each character's ASCII code and express it as an 8-bit binary number. This converter does this automatically in the ASCII Text section.
ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns numbers 0–127 to English letters, digits, punctuation, and control characters. For example, 'A' is 65, 'Z' is 90, 'a' is 97, and '0' is 48. ASCII was the dominant encoding standard before Unicode, and it remains the foundation of modern character encoding.
This converter handles non-negative integers. In computing, negative numbers are typically represented using two's complement notation, where the most significant bit indicates the sign. Two's complement is beyond the scope of this basic converter, but you can find dedicated two's complement calculators for signed integer work.
JavaScript safely represents integers up to 2^53 − 1 (9,007,199,254,740,991). This is approximately 9 quadrillion. Numbers larger than this may lose precision in the conversion. For very large numbers, consider using a big integer library or a specialized arbitrary-precision converter.

Sources and References

Related Calculators