Number Base Converter

Convert numbers, analyze representations, decode floating-point values, and explore base systems.

Results are calculated automatically as you enter data.

Converted Value -
Binary-
Octal-
Decimal-
Hexadecimal-
Bit View-
IEEE-754 Float32-
IEEE-754 Float64-
Conversion steps
Formula
-

Supports bases 2-36, large integers, fractions, text encoding, signed interpretation, IEEE-754 decoding, and educational conversion breakdowns.

▼ See explanations and tips below ▼

What Is Number Base Conversion?

Number base conversion is the process of rewriting the same value in a different positional numeral system. The value does not change; only the symbols and place values used to write it change.

For example, the decimal number \(255_{10}\), the binary number \(11111111_2\), and the hexadecimal number \(\text{FF}_{16}\) all represent the same quantity. They look different because each base groups value by a different power:

  • Base 2 groups by powers of \(2\) and uses the digits \(0\) and \(1\).
  • Base 8 groups by powers of \(8\) and uses digits \(0\) through \(7\).
  • Base 10 groups by powers of \(10\) and uses digits \(0\) through \(9\).
  • Base 16 groups by powers of \(16\) and uses \(0\) through \(9\), then \(A\) through \(F\).

Base conversion is useful because different fields prefer different representations. People usually read decimal. Computers store and process data as bits. Programmers often use hexadecimal because it is a compact way to write binary patterns.


Why Number Base Conversion Matters

Base conversion helps connect human-readable numbers with machine-level representations. A student might use it to understand place value, a programmer might use it to inspect memory or bit masks, and an educator might use it to show why the same quantity can be written in several valid ways.

It also helps avoid practical mistakes. If a value is supposed to be binary, a digit such as \(2\) is impossible. If a value is hexadecimal, \(A\) means ten, not the letter A in ordinary text. If a value is shown as IEEE-754 floating-point bytes, it is not the same thing as an ordinary hexadecimal integer.


Key Terms to Know

Term Meaning
Base or radix The number of distinct digit values used by a positional system. Base \(b\) uses digit values from \(0\) through \(b-1\).
Digit value The numeric value of one symbol. In hexadecimal, \(A=10\), \(B=11\), \(C=12\), \(D=13\), \(E=14\), and \(F=15\).
Place value The value contributed by a digit because of its position. Each step left multiplies by the base; each step right of the radix point divides by the base.
Radix point The point separating whole-number positions from fractional positions. In decimal it is often called the decimal point.
Bit A binary digit, either \(0\) or \(1\).
Nibble A group of \(4\) bits. One hexadecimal digit corresponds exactly to one nibble.
Code point A numeric value assigned to a Unicode character.
Two's complement A common fixed-width method for interpreting binary patterns as signed integers.
IEEE-754 A widely used standard for representing floating-point numbers such as single precision and double precision.

How Number Base Conversion Works

A positional number is a sum of digit values multiplied by powers of the base. For a base \(b\), each digit \(d_i\) contributes \(d_i b^i\), where \(i\) is the digit's position.

A compact way to write this is:

$$ N = \sum_{i=-m}^{k} d_i b^i $$

Where:

  • \(N\) is the value represented by the number.
  • \(b\) is the base.
  • \(d_i\) is the digit value at position \(i\).
  • Positive powers are whole-number positions.
  • Negative powers are fractional positions.

For example:

$$ \text{1011.101}_2 = 1\times2^3 + 0\times2^2 + 1\times2^1 + 1\times2^0 + 1\times2^{-1} + 0\times2^{-2} + 1\times2^{-3} $$
$$ \text{1011.101}_2 = 8 + 0 + 2 + 1 + \frac{1}{2} + 0 + \frac{1}{8} = 11.625_{10} $$

This same idea works for any supported base. The only difference is the value of \(b\) and the allowed digits.

Converting an Integer to Another Base

To convert a whole number from decimal into another base, repeatedly divide by the target base and record the remainders. The remainders become the new digits, read from last to first.

For example, convert \(255_{10}\) to base \(16\):

$$ 255 \div 16 = 15 \text{ remainder } 15 $$
$$ 15 \div 16 = 0 \text{ remainder } 15 $$

The remainder value \(15\) is written as \(F\) in hexadecimal, so:

$$ 255_{10} = \text{FF}_{16} $$

Converting a Fractional Part to Another Base

Fractional conversion works in the opposite direction. Multiply the fractional part by the target base, record the whole-number part, and repeat with the new fractional remainder.

For example, convert \(0.625_{10}\) to binary:

$$ 0.625 \times 2 = 1.25 \quad \Rightarrow \quad \text{first digit } 1 $$
$$ 0.25 \times 2 = 0.5 \quad \Rightarrow \quad \text{second digit } 0 $$
$$ 0.5 \times 2 = 1.0 \quad \Rightarrow \quad \text{third digit } 1 $$

So:

$$ 0.625_{10} = 0.101_2 $$

Some fractions terminate in one base but repeat in another. For example, \(0.1_{10}\) does not have a finite binary representation, so a fixed-length binary output must eventually stop and show an approximation.


Common Bases and What They Are Used For

Base Name Digits Common use
\(2\) Binary \(0,1\) Bits, logic, machine-level representation
\(8\) Octal \(0\)–\(7\) Compact grouping of binary in 3-bit groups
\(10\) Decimal \(0\)–\(9\) Everyday arithmetic and measurement
\(16\) Hexadecimal \(0\)–\(9\), \(A\)–\(F\) Compact grouping of binary in 4-bit groups, memory addresses, color values, byte values

The calculator supports bases from \(2\) through \(36\). For bases above \(10\), letters represent digit values above nine. For example, in base \(36\), \(Z\) represents \(35\).


Text, Code Points, and Number Bases

Text conversion is different from ordinary number conversion. A character is first identified by its Unicode code point, then that numeric code point can be written in binary, octal, decimal, hexadecimal, or another supported base.

For example, the character A has code point \(65_{10}\). As a number, that can be written as:

$$ 65_{10} = 1000001_2 = 101_8 = 41_{16} $$

In text mode, each Unicode code point is handled separately, including leading, trailing, and repeated whitespace. The result is a list of code-point values, not one combined number and not a decoding tool that turns numeric code points back into characters.


Two's-Complement Signed Integers

Unsigned integers treat every bit pattern as zero or positive. Signed integers need a way to represent negative values too. Two's complement is a common method that gives each fixed-width bit pattern a signed meaning.

For a width of \(w\) bits, the usual signed range is:

$$ -2^{w-1} \le x \le 2^{w-1} - 1 $$

For \(8\) bits, that range is:

$$ -128 \le x \le 127 $$

A useful interpretation rule is:

$$ \text{signed value} = \begin{cases} u, & \text{if } u < 2^{w-1} \\ u - 2^w, & \text{if } u \ge 2^{w-1} \end{cases} $$

Where \(u\) is the unsigned value of the same bit pattern.

For example, \(11111111_2\) is \(255\) as an unsigned 8-bit value. In 8-bit two's-complement interpretation, the sign bit is set, so:

$$ 255 - 2^8 = 255 - 256 = -1 $$

That is why bit width matters. The same written digits can have a different signed meaning when interpreted with a different number of bits.


IEEE-754 Floating-Point Encodings

Floating-point representation is used for numbers that may have fractional parts or very large and very small magnitudes. Instead of simply rewriting an integer in another base, an IEEE-754 floating-point value stores information such as a sign, an exponent, and a significand.

For normal binary floating-point values, the idea can be summarized as:

$$ (-1)^s \times 1.f \times 2^{e-\text{bias}} $$

Where:

  • \(s\) is the sign bit.
  • \(f\) is the fractional part of the significand.
  • \(e\) is the stored exponent value.
  • The bias depends on the format.

This is why an ordinary hexadecimal conversion and an IEEE-754 hexadecimal byte encoding are not the same thing. The integer \(1_{10}\) is simply \(1_{16}\), but the IEEE-754 single-precision encoding of the floating-point value \(1.0\) is commonly shown as 0x3F800000. That byte string describes the floating-point layout, not the integer written in base \(16\).


Examples of Number Base Conversion in Practice

Example 1: Decimal to Hexadecimal

Convert \(4095_{10}\) to base \(16\).

Divide by \(16\) and collect remainders:

$$ \begin{aligned} 4095 \div 16 &= 255 \text{ remainder } 15 \\ 255 \div 16 &= 15 \text{ remainder } 15 \\ 15 \div 16 &= 0 \text{ remainder } 15 \end{aligned} $$

Each remainder \(15\) becomes \(F\), so:

$$ 4095_{10} = \text{FFF}_{16} $$

Example 2: Binary Fraction to Decimal

Convert \(10.011_2\) to decimal.

$$ \text{10.011}_2 = 1\times2^1 + 0\times2^0 + 0\times2^{-1} + 1\times2^{-2} + 1\times2^{-3} $$
$$ \text{10.011}_2 = 2 + 0 + 0 + \frac{1}{4} + \frac{1}{8} = 2.375_{10} $$

Example 3: A Repeating Fraction

Convert \(0.1_{10}\) to binary. Repeated multiplication begins like this:

$$ \begin{aligned} 0.1 \times 2 &= 0.2 \quad \Rightarrow 0 \\ 0.2 \times 2 &= 0.4 \quad \Rightarrow 0 \\ 0.4 \times 2 &= 0.8 \quad \Rightarrow 0 \\ 0.8 \times 2 &= 1.6 \quad \Rightarrow 1 \\ 0.6 \times 2 &= 1.2 \quad \Rightarrow 1 \end{aligned} $$

The pattern continues rather than ending neatly, so a calculator that shows a fixed number of fractional digits must stop at some point. This calculator shows a fixed 10-digit fractional output for fractional base conversions, generated by truncating the repeated-multiplication process rather than rounding a final exact value.


Example 4: Text Character to Code Point

For the text character A, the code point is \(65_{10}\). Written in common bases:

$$ 65_{10} = 1000001_2 = 101_8 = 41_{16} $$

For a word or phrase, each character is converted separately. The output is therefore a sequence of numbers, one per character.


How to Interpret the Result

The Converted result is the main answer in the selected target base. It tells you how the input value is written using the target base's digit symbols.

The binary, octal, decimal, and hexadecimal outputs are common equivalent representations. They are useful for checking your work because the same value should be consistent across bases.

The Bits output is a grouped binary display for readability. Grouping bits in sets of four makes long binary strings easier to scan and lines up naturally with hexadecimal digits. It should not always be read as a fixed-width storage layout.

In text mode, each output value corresponds to one Unicode character's code point. A sequence such as 48 69 in decimal text output means two separate character values, not the single number \(4869\).

In two's-complement mode, the decimal result is the signed interpretation after applying the selected bit width. If the sign bit is set, the signed value may be negative even though the same bits would be positive in unsigned mode.

The Float32 and Float64 outputs are IEEE-754 floating-point encodings of the numeric value. They are best understood as byte-level representations of a floating-point format, not as ordinary base-conversion results.


Common Mistakes and Misconceptions

Using digits that do not exist in the selected base. In base \(2\), only \(0\) and \(1\) are valid. In base \(8\), \(8\) and \(9\) are invalid. In base \(16\), \(G\) is invalid because hexadecimal only goes up to \(F\).

Expecting base prefixes to be auto-detected. Notation such as 0b1010, 0o12, or 0xFF is common in programming languages, but the numeric value itself should be entered using digits valid for the chosen input base.

Confusing text conversion with numeric conversion. Entering A as text means “convert the Unicode code point for the character A.” Entering A as a number in base \(16\) means “the digit with value ten.”

Using fractions with two's-complement mode. Two's complement is a fixed-width integer interpretation. It is not a fractional-number format.

Rounding too early. If you are doing a conversion by hand, keep enough intermediate digits before rounding. Repeating fractions can produce long or infinite expansions in another base.

Treating IEEE-754 bytes as ordinary hexadecimal integers. A Float32 or Float64 result describes a floating-point storage format. It should not be interpreted the same way as the hexadecimal field for an integer value.


When to Use Number Base Conversion

Use number base conversion when you need to:

  • Translate values between binary, octal, decimal, hexadecimal, or another radix.
  • Check computer-science homework involving positional notation.
  • Understand bit patterns, masks, byte values, or low-level data formats.
  • Compare signed and unsigned interpretations of the same integer pattern.
  • Convert Unicode text characters into numeric code-point values.
  • Inspect how a numeric value is encoded as IEEE-754 Float32 or Float64 bytes.
  • Teach or learn why place value works in bases other than ten.

Limitations and Things to Keep in Mind

The supported numeric bases are integers from \(2\) through \(36\). Digits are written with \(0\) through \(9\) and letters \(A\) through \(Z\), so bases higher than \(36\) are not represented.

Integer base conversions are exact. Fractional inputs are represented as exact ratios, then converted with repeated integer multiplication. The fractional target-base output is fixed to 10 digits after the radix point; terminating values retain trailing zeroes to that width, while repeating values are truncated rather than rounded.

Two's-complement mode applies only to integers and requires a positive bit width. It interprets the value using the selected width, but the converted result is displayed as a signed value rather than as a padded fixed-width bit pattern.

Very large integer values can be converted exactly between bases for the ordinary outputs, and their fractional parts are converted exactly until the fixed 10-digit display limit. Floating-point outputs are different because Float32 and Float64 have finite precision. Very large or highly precise numbers may lose precision or may not fit as finite floating-point values.

The calculator does not treat programming-style prefixes, commas, spaces, scientific notation, or alternative decimal separators as numeric notation. Use the selected input base and enter the digits directly.

Text mode converts every entered Unicode code point to a code-point number without trimming the text. It does not decode a list of entered numeric code points back into text.

For important technical work, use base-conversion results as a check, but also confirm the required format, width, byte order, rounding rule, and signedness expected by the system you are working with.


How to Use This Calculator

  1. Choose number mode or text mode.
  2. Enter the value you want to convert.
  3. In number mode, choose the input base from \(2\) through \(36\).
  4. Choose the target base from \(2\) through \(36\).
  5. For signed integer interpretation, choose two's-complement mode and enter a positive bit width.
  6. Review the main converted value along with the binary, octal, decimal, hexadecimal, grouped-bit, Float32, Float64, and steps outputs.

Frequently Asked Questions

Why does hexadecimal use letters?

Hexadecimal is base \(16\), so it needs sixteen digit values. The ten decimal digits cover \(0\) through \(9\), and letters \(A\) through \(F\) represent values \(10\) through \(15\).


Is binary conversion exact?

Whole-number conversion between bases is exact. Fractional conversion uses the exact input ratio, although some fractions repeat forever in another base. The calculator shows ten fractional digits: terminating values are zero-padded and repeating values are shortened without rounding.


What is the difference between unsigned and two's-complement mode?

Unsigned mode treats the digits as a nonnegative value. Two's-complement mode interprets an integer using a fixed bit width, so values with the sign bit set are interpreted as negative. The same bit pattern can therefore have different meanings in unsigned and signed mode.


Can I type 0xFF for hexadecimal input?

No. Select base \(16\) as the input base and enter FF. Prefixes such as 0x, 0b, and 0o are notation used in many programming languages, but they are not part of the digit string for this calculator.


What does text mode do?

Text mode converts each Unicode code point, including spaces and other leading or trailing whitespace, and then writes that numeric value in the selected target base and common bases. It does not combine the characters into one large number, and it does not decode numeric code points back into text.


Are Float32 and Float64 outputs the same as hexadecimal conversion?

No. The hexadecimal output is the value written in base \(16\). Float32 and Float64 are IEEE-754 floating-point byte encodings of the numeric value, so they include floating-point format details such as sign, exponent, and significand fields.


Sources and References

Books

  1. Randal E. Bryant and David R. O'Hallaron. Computer Systems: A Programmer's Perspective. 3rd ed., Pearson, 2016. Chapter 2, “Representing and Manipulating Information,” especially hexadecimal notation, integer representations, two's-complement encodings, and floating-point representation.
  2. Yale N. Patt and Sanjay J. Patel. Introduction to Computing Systems: From Bits & Gates to C/C++ & Beyond. 3rd ed., McGraw Hill, 2020. Chapter 2, data representation, binary and decimal conversion, and two's-complement integers.
  3. David A. Patterson and John L. Hennessy. Computer Organization and Design: The Hardware/Software Interface. Revised 4th ed., Morgan Kaufmann/Elsevier, 2012. Chapter 3, “Arithmetic for Computers.”

Online and Official Sources

  1. Unicode Consortium. “The Unicode Standard: A Technical Introduction.” Accessed July 4, 2026.
  2. Unicode Consortium. “Glossary of Unicode Terms.” Accessed July 4, 2026.
  3. IEEE Standards Association. “IEEE 754-2019 - IEEE Standard for Floating-Point Arithmetic.” Published July 22, 2019.
  4. OpenStax via LibreTexts. “4.2: Converting with Base Systems.” Mathematics LibreTexts, last updated January 2, 2025.
  5. OpenStax. “5.3 Machine-Level Information Representation.” Introduction to Computer Science. Accessed July 4, 2026.