Skip to content
Calcipedia
Base Converter instructional illustration

Base Converter

Convert between bases 2 and 36 with binary, decimal, hex, octal, radix, fractional, grouped-input, and exact working-table support.

Last updated

Base converter use case Use this base converter to move exact values between binary, octal, decimal, hexadecimal, and other bases up to 36. It shows source-base place values, repeated-division steps, common base cross-checks, and exact fractions where the input has a radix point.
Quick examples
Accepted input Enter whole numbers or finite fractional values. This page accepts optional leading `-`, plus common `0b`, `0o`, and `0x` prefixes when they match the selected source base, and ignores spaces or underscores used as separators.

Result

FF

Normalized input: 255

Common bases

The value column is the exact copy-safe output. The grouped display column is visual only: binary is grouped by nibbles, octal and decimal by threes, and hexadecimal by byte pairs where possible.

BaseValueGrouped displayAction
Binary (2)111111111111 1111
Octal (8)377377
Decimal (10)255255
Hexadecimal (16)FFFF

Source-base place values

DigitValuePowerContribution
2210^2200
5510^150
5515

Repeated division into base 16

QuotientRemainder
15F
0F
How to read the base conversion tables The place-value table shows how the source number becomes an exact value, digit by digit. For integer parts, the repeated-division table shows the remainders that rebuild the target-base answer from the bottom up. Fractional digits use negative powers and may terminate in one base while repeating in another.
← All Number Theory calculators

Number Systems

Base converter: exact conversion between bases 2 and 36

A base converter turns a value from one positional number system into another. This base converter supports exact conversion between bases 2 and 36, covers binary to decimal, decimal to binary, binary to hex, hex to decimal, octal conversions, common prefixes, grouped input, and finite fractional inputs, then shows the source-base place values and repeated-division path behind the result.

How general base conversion works

The standard method has two stages. First, read the input in its original base by multiplying each digit by the appropriate power of that base and summing the contributions. Second, rebuild the number in the target base by repeated division, recording remainders until the quotient reaches zero.

This is why a base converter should do more than show one final answer. The place-value table explains where the source number comes from, and the repeated-division table explains why the target digits appear in the order they do.

value = Σ(digit_i × base^power_i)

Positional notation rule used to read the original number.

Repeatedly divide by the target base and read remainders from last to first

Standard method for rebuilding an integer in the target base.

Worked example: converting 2F from base 16 to base 10 and base 2

To read 2F₁₆, take 2 × 16^1 + 15 × 16^0 = 32 + 15 = 47. That gives the exact decimal value. From there, converting to binary means repeatedly dividing 47 by 2, collecting remainders, and reading them in reverse order, which gives 101111₂.

That same example shows why hexadecimal is convenient: one short two-digit hex value expands into six binary digits and a two-digit decimal value, but all three representations still describe the same integer. A strong base converter makes those cross-checks visible at once.

Why base conversion is useful in programming and electronics

Binary, octal, decimal, and hexadecimal are the most common bases people switch between when reading machine instructions, memory addresses, and compact identifiers. A base converter makes that switch explicit so the same integer can be checked in whichever representation is easiest to reason about.

That is also why this page shows a place-value table and a repeated-division table. Those working steps are useful when you want to verify a conversion by hand, not just copy the answer into another tool.

Signs, prefixes, and separators

Programming-style prefixes such as 0b, 0o, and 0x are just input aids. They tell you how to interpret the following digits, but they are not extra digits themselves. This converter strips the matching prefix when it agrees with the selected source base.

Likewise, spaces and underscores are often used to group long values for readability. They do not change the arithmetic, so the calculator ignores them before validating the digits. A leading minus sign is preserved and applied after the unsigned magnitude is parsed.

Reading grouped output without changing the value

Long converted values are easier to check when they are grouped visually. Binary is commonly grouped in four-bit nibbles or eight-bit bytes, octal and decimal are often grouped in threes, and hexadecimal is often grouped in byte pairs when the value represents computer data.

Grouping is display-only. The exact output remains the continuous value shown in the copy-safe result column, while the grouped display column helps you scan the same number for byte boundaries, octal triads, decimal thousands, or likely transcription errors.

Choosing the right base conversion workflow

Use the quick examples when you want a common binary, octal, decimal, hexadecimal, or base-36 conversion without setting every field by hand. Use the source and target base controls when you need a less common radix, such as base 3, base 7, base 12, or base 32. The common-bases table remains visible either way, so a custom base conversion still gives you the familiar binary, octal, decimal, and hex cross-checks.

The swap control is useful when you are checking a reversible conversion. For example, convert decimal 255 to hexadecimal FF, swap the bases, and the input becomes FF from base 16 back to base 10. That makes the page more than a one-way number base converter: it becomes a compact worksheet for confirming that the source digits, target result, and common representations all describe the same integer.

Binary to decimal and binary fraction conversion

For binary to decimal conversion, each 1 bit activates a power of 2. Whole-number places use 2^0, 2^1, 2^2, and so on as you move left. Fractional binary places use 2^-1, 2^-2, 2^-3, and so on as you move right. That is why 1011.01₂ becomes 8 + 2 + 1 + 1/4, or exactly 45/4 = 11.25.

The binary to decimal preset keeps the old directional workflow intact while adding the broader base-converter cross-checks. It accepts grouped bits such as 0001 0101, programmer-style 0b prefixes, and binary fractions such as 1011.01. The exact-value line is especially useful for binary fraction converter searches because it shows the rational value behind the decimal string.

binary decimal value = Σ(bit_i × 2^i)

Integer bits use non-negative powers of 2, while binary fraction bits use negative powers of 2.

Binary to hex and binary to octal grouping

Binary to hex conversion is fast because one hexadecimal digit maps to exactly four binary bits. Start at the right edge, group the binary value into 4-bit nibbles, pad the leftmost group with leading zeros if needed, and map each nibble to 0 through F. For example, 11011110₂ splits into 1101 and 1110, which become D and E, so the hex result is DE.

Binary to octal uses the same idea with 3-bit triads because 8 = 2^3. The binary value 111101101₂ splits into 111, 101, and 101, which map to octal 755. This grouping context preserves the old binary to hex converter and binary to octal converter search intent without keeping separate indexable pages for each direction.

The in-page binary grouping worksheet keeps that directional detail visible on the canonical base converter. For binary-to-hex and binary-to-octal examples, it shows the original bits, the padded nibble or triad, the group value, and the output digit so left-padding can be checked without confusing it for an extra stored bit.

1 hex digit = 4 binary bits

The binary-to-hex shortcut works because 16 equals 2^4.

1 octal digit = 3 binary bits

The binary-to-octal shortcut works because 8 equals 2^3.

Decimal to binary, decimal to hex, and decimal to octal

When the source is decimal and the target is binary, hexadecimal, or octal, repeated division is the standard hand-check method. Divide the decimal value by the target base, record each remainder, continue with the quotient, and read the remainders from last to first. That is the workflow behind decimal to binary, decimal to hex, and decimal to octal conversions.

For example, decimal 156 divided repeatedly by 2 gives the binary answer 10011100. Decimal 255 divided by 16 gives FF, and decimal 493 divided by 8 gives 755. The preset chips load those common workflows directly so the page still answers long-tail queries like decimal to binary converter with steps and decimal to hexadecimal converter.

Hex to binary, hex to decimal, hex to octal, and octal back again

Hexadecimal and octal are compact ways to write binary-friendly values. Hex to binary expands each hex digit into a 4-bit nibble, while octal to binary expands each octal digit into a 3-bit group. Hex to octal and octal to hex are often easiest to reason about by expanding through binary first and then regrouping.

Hex to decimal and octal to decimal use ordinary positional notation. A hex digit such as F contributes 15 times its place value, while an octal digit such as 7 contributes seven times its power of 8. The common-bases table shows these cross-checks together, which reduces the need to run separate hex to decimal, octal to decimal, or octal to hex tools.

When the source is hexadecimal or octal and the target is binary, the worksheet separates width-preserved binary from significant binary. A value such as 0x1A is still numerically 11010₂, but the width-preserved display remains 0001 1010 so each original hex digit keeps its full nibble.

Leading zeros, signed values, and two's-complement limits

Leading zeros do not change an unsigned value, but they can matter when you are inspecting fixed-width storage. The bit string 00001111 and 1111 have the same unsigned decimal value, yet the first one visibly fits into an 8-bit byte boundary. The same caution applies to nibble and triad grouping: left-padding clarifies the group, but it is not automatically an extra stored bit.

Signed machine interpretation is a separate layer. The bit string 11111111 is 255 as an unsigned 8-bit value, but it can mean -1 under signed 8-bit two's-complement rules. This base converter reports the mathematical value of the digits you enter. It does not infer storage width, signedness, endian order, IEEE floating-point layout, packed flags, ASCII text, or programming-language parsing semantics.

Practical checks before copying a converted value

Before copying a base conversion into code, documentation, an exam answer, or a hardware note, check the selected source base, the normalized input, and the target-base result together. Many conversion mistakes come from treating a decimal-looking string as hexadecimal, or from pasting a prefixed value while the source base is still set to decimal.

For long values, the common-base outputs help catch transcription mistakes. A binary result that is one bit longer than expected, an octal value with a surprising leading digit, or a hexadecimal value that does not match a familiar byte boundary is a sign to recheck the input grouping before using the result downstream.

What this base converter does not handle

This page supports finite fractional inputs, but a fractional value can terminate in one base and repeat in another. When the target-base fractional expansion repeats, the calculator marks the repeating part in parentheses or limits very long output to a practical displayed length.

It also does not infer floating-point formats, two's-complement storage widths, packed bytes, ASCII text, endian-specific byte structure, or language-specific parsing rules. If your input belongs to a machine format, keep that semantic layer separate from the base conversion itself.

Frequently asked questions

Can this base converter handle fractional numbers?

Yes, for finite fractional inputs written directly in the source base. Digits to the right of the radix point use negative powers of the source base. Some target-base fractions terminate cleanly, while others repeat; repeating target digits are marked in parentheses or limited to a practical displayed length.

Is 0x or 0b a valid prefix?

Yes, as long as the prefix matches the selected source base. For example, 0xFF is accepted when the source base is 16, and 0b1010 is accepted when the source base is 2. The prefix is stripped before conversion because it is just notation, not part of the value.

Why does this converter show decimal, binary, octal, and hex together?

Those four bases are the most common checkpoints in programming and electronics. Showing them together makes it easier to verify the answer and spot transcription errors without rerunning the same conversion repeatedly.

Will large numbers lose precision?

Not on this page for integer inputs. The converter uses exact integer arithmetic rather than JavaScript's normal floating-point number type, so long values such as FFFFFFFFFFFFFFFF remain exact instead of rounding silently.

Can this converter handle base 36?

Yes. Bases 2 through 36 are supported, so letters A through Z are available for digit values 10 through 35. That covers binary, octal, decimal, hexadecimal, and many custom number systems.

What is the difference between a base converter and a radix converter?

For this type of tool, the terms usually mean the same thing. A radix converter or number base converter changes a value from one positional numeral system into another. This page uses base converter in the title because that is the more common search phrase, but the working method is the same radix conversion method: evaluate the source digits by place value, then rebuild the value in the target base.

Why should I check the normalized input before using the answer?

The normalized input shows exactly what the calculator converted after removing accepted prefixes and separators. If you pasted 0xFF while the source base was set to 16, the normalized input is FF. If the source base is wrong, the page will either reject the value or show a normalized string that helps you spot the mismatch before copying the result.

Does grouped output change the converted value?

No. Grouped output is only a readability aid. Binary grouping by four, hexadecimal grouping by pairs, and decimal grouping by thousands all show the same value with spaces inserted. Use the exact value column when you need a copy-safe string without visual separators.

Can I reverse a conversion to check it?

Yes. Use the swap control after a valid conversion. The current result becomes the new input, and the source and target bases trade places. A decimal to hexadecimal conversion such as 255 to FF should then convert back from FF in base 16 to 255 in base 10.

Why does the target-base table read from bottom to top?

Repeated division produces remainders in the opposite order from the final answer. The first remainder is the least-significant digit, so the correct target-base number appears when the remainders are read from last to first.

How do I use this as a binary to decimal converter?

Choose the Binary to decimal preset or set the source base to 2 and the target base to 10. You can paste plain bits, grouped bits, a 0b prefix, or a finite binary fraction such as 1011.01. The place-value table shows the powers of 2 that produce the decimal answer.

Why does binary to hex group bits into four?

Four binary bits have 16 possible values, exactly matching one hexadecimal digit from 0 to F. Grouping from the right into 4-bit nibbles lets you convert binary to hexadecimal one group at a time.

Why does binary to octal group bits into three?

Three binary bits have 8 possible values, exactly matching one octal digit from 0 to 7. Grouping from the right into 3-bit triads lets you convert binary to octal without doing a full decimal detour by hand.

Should I pad binary groups from the left or the right?

Pad the leftmost group with leading zeros when you need a complete nibble or triad for display. Padding on the right changes the value because it shifts the original number by a power of 2.

Can this replace separate hex to decimal or octal to hex converters?

Yes for plain positional-number conversion. Set the source and target bases or use the matching preset. Keep a separate specialist workflow only when the input represents a machine format, text encoding, byte order, signed integer, or other semantic layer beyond the digits themselves.

Is this a two's-complement signed binary decoder?

No. The converter reports the mathematical value of the entered digits. A signed two's-complement interpretation requires a fixed bit width and signedness rule, so the same bit string can mean different values in different storage contexts.

Why can a fraction repeat after conversion?

A fraction terminates in a target base only when its reduced denominator is compatible with that base's prime factors. For example, 0.1 in decimal does not terminate in binary, so the base-2 expansion repeats even though the decimal input looks short.

Also in Number Theory

Related

More from nearby categories

These related calculators come from the same leaf category, nearby sibling categories, or the same top-level topic.