CalcHub

Number Base Converter

This number base converter shows binary, octal, decimal, and hexadecimal representations at once. Pick the base of your input, type a number, and see it converted to all four bases simultaneously. Calculations use BigInt, so numbers of any size are converted exactly with no digit limit, and negative numbers are supported with a leading minus sign (-). Decimals are not supported — integers only.

Integers only (no decimals; use a leading - for negative numbers)

Examples

Decimal 255 in other bases

Decimal 255 is 1111 1111 in binary, 377 in octal, and FF in hexadecimal. Since 255 = 2⁸ − 1, its binary form is eight 1s in a row.

Hexadecimal FF to decimal

Hexadecimal FF equals F(15) × 16 + F(15) = 240 + 15 = 255. The FF in the CSS color #FF0000 is exactly this — a red component of 255.

Binary 1010 in other bases

Binary 1010 is 8 + 2 = 10 in decimal, 12 in octal, and A in hexadecimal. One hexadecimal digit corresponds exactly to four binary digits.

FAQ

What is a binary number?

Binary is a number system that uses only two digits, 0 and 1. Computers represent all data with electrical signals that are either on (1) or off (0), so internally every number is processed in binary. From right to left, each digit position is worth a power of two: 1, 2, 4, 8, 16, and so on.

Where is hexadecimal used?

Hexadecimal is widely used in development because one hex digit stands for exactly four binary digits, making long bit strings compact. Common examples include CSS color codes (#FF5733), memory addresses (0x7FFF…), binary dumps, MAC addresses, and Unicode code points (U+AC00).

How are negative numbers represented?

This calculator uses sign notation: a minus sign (-) placed in front of the number indicates a negative value. For example, decimal -10 is shown as -1010 in binary. This is different from the two's complement representation that computers use internally.

How is this different from two's complement?

Two's complement represents negative numbers within a fixed number of bits (e.g. 8-bit or 32-bit); -10 in 8-bit two's complement is 11110110. This calculator performs mathematical conversion without a bit-width limit, so it keeps the explicit minus sign instead. The same negative number looks different in the two notations, so use the one that matches your purpose.

Can it convert very large numbers?

Yes. The calculator uses JavaScript's BigInt, so numbers hundreds of digits long — far beyond the usual 64-bit integer range (about 9.2 × 10¹⁸) — are converted exactly with no rounding errors. Note that only integers are supported; numbers with a fractional part cannot be converted.

What is a number base?

A number base (radix) is a way of writing numbers: base n uses n digits, and each position is worth a power of n. The decimal system we use daily has ten digits (0-9); for example, 234 means 2×10² + 3×10¹ + 4×10⁰.

By the same principle, binary 1011 is 1×8 + 0×4 + 1×2 + 1×1 = 11 in decimal, and hexadecimal extends the digits with the letters A(10) through F(15). Whatever the base, the underlying number is the same — only the notation differs.

Number bases in software development

Because one hexadecimal digit maps to four binary digits and one octal digit maps to three, they are used to write long bit strings compactly. Typical examples are file permissions (Linux chmod 755 is octal), color codes (#1E90FF), bit masks (0xFF00), memory addresses, and hash values.

Programming languages distinguish bases with prefixes such as 0b1010 (binary), 0o755 (octal), and 0xFF (hexadecimal). In this calculator, simply enter the digits without any prefix.