COMPUTER SCIENCE / NUMBER SYSTEMS

Number Base Converter for Binary, Decimal, Hexadecimal and Bases 2 to 36

Convert signed integers or fractional values exactly, inspect common representations and see how positional notation produces the value.

Enter a number

Digits above 9 use A–Z. One radix point and an optional leading + or − are accepted. Matching 0b, 0o and 0x prefixes and underscore digit separators may be included.

How positional number bases work

A base determines the available digits and the value of each position. Decimal uses ten digits and powers of 10; binary uses 0 and 1 with powers of 2; hexadecimal uses 0–9 and A–F with powers of 16. In base b, the positions to the left of the point represent b⁰, b¹, b² and so on.

For example, 101101₂ = 1×2⁵ + 0×2⁴ + 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 45₁₀.

Fractional digits and recurring results

Positions to the right of the radix point use negative powers: the first is b⁻¹, the second b⁻². Therefore .011₂ = 0×1/2 + 1×1/4 + 1×1/8 = 3/8. The converter stores the entered value as an exact fraction before producing other bases.

Some fractions terminate in one base but repeat in another. Decimal 0.1 terminates in base 10 but repeats in binary. Repeating digits are enclosed in parentheses when a cycle is found; an ellipsis means the selected precision was reached first.

Where base conversion is used

Debugging IDs, addresses and protocol fields

A log may print an identifier as decimal while a debugger or protocol document uses hexadecimal. Converting both representations confirms whether they describe the same value. Binary is useful when individual flag bits matter; hexadecimal is easier to scan because each hex digit represents exactly four bits.

Working with web colours and encoded bytes

An RGB channel value such as decimal 172 becomes AC in hexadecimal. That makes rgb(172, 60, 83) equivalent to #AC3C53. This is numeric conversion only: decoding bytes into text still requires an ASCII or Unicode tool.

Checking digital logic and embedded registers

Datasheets often show register addresses and masks in hex, while timing diagrams expose the individual binary lines. Converting a register value to padded binary makes it easier to see which status or control bits are set.

Learning place value and repeated division

Students can compare the exact place-value expansion with the result. Repeated division by the target base supplies integer remainders from right to left; repeated multiplication of a fractional remainder supplies digits after the radix point.

Conversion examples

ValueEquivalent representations and context
42₁₀101010₂ = 52₈ = 2A₁₆
FF₁₆255₁₀ = 11111111₂, the largest unsigned 8-bit value
10.5₁₀1010.1₂ = A.8₁₆
0.1₁₀0.0(0011)₂; the repeating group explains common binary floating-point approximations
1,000,000₁₀F4240₁₆ = 11110100001001000000₂
AC₁₆172₁₀ = 10101100₂; useful for one RGB channel or an 8-bit register

Limits and notation

This tool converts numerical values, not text encodings. “41” in hexadecimal is the number 65; interpreting that byte as the letter A requires an ASCII or Unicode tool. Very long output is limited by the fractional-precision setting, while the integer part uses arbitrary-precision arithmetic.

Frequently asked questions

Why are hexadecimal digits A to F?

A base-16 system needs six digits after 9. A through F represent decimal values 10 through 15.

Is 10 always ten?

No. The written value 10 means one group of the base and zero units: 10₂ is 2, 10₈ is 8 and 10₁₆ is 16.

Why does a converted fraction sometimes repeat?

A fraction terminates only when its reduced denominator divides a power of the target base. Otherwise its long-division remainders eventually repeat.

Does the converter support negative numbers?

Yes. A leading minus sign is preserved. This is sign-and-magnitude notation, not a fixed-width two’s-complement encoding.

Can I paste 0b or 0x values from source code?

Yes. When the source base matches, the converter accepts 0b for binary, 0o for octal and 0x for hexadecimal. Underscores used as digit separators are ignored.

Why is this different from Base64?

A number base changes the written representation of a numerical value. Base64 encodes a sequence of bytes as text; it is not ordinary positional-number conversion.

Will very large integers be rounded?

No. Integer and fractional input is stored as an exact ratio of arbitrary-size integers. Only displayed non-terminating fractions are shortened at the precision selected above.

← Number-system calculators