calculator.onl
Categories50

Integer base converter: decimal, hex and binary

Convert a signed integer between bases 2–36. Choose the input base, output base and digit grouping; inspect the exact decimal value and place values.

A worked example

Write decimal 255 in base 2 and then in base 16. Eight binary digits become two hexadecimal digits, FF. The display rearranges while the value stays the same.

Converted integerFFDecimal255# Digit2# bit8
Up to 256 digits; no fractions, prefixes or separators in the input. A minus sign is a sign, not two’s complement.

Radix used to read the input digits. For example, base 16 accepts A through F. Input base: 2…36

Radix in which to write the converted value. Output base: 2…36

Digit grouping: None / 4 / 8

Updates as you type

Use a dot or comma for decimals. No thousands separators.

YOUR RESULT

Converted integer

FF

Calculated from your inputs

Decimal255
# Digit2
# bit8
The numbers, at a glance

Calculations run in your browser.
UNDERSTAND THE RESULT

A little context. A clearer answer.

↑ Back to calculator

When this calculator is useful

Convert a signed integer between bases 2–36. Choose the input base, output base and digit grouping; inspect the exact decimal value and place values. For a related calculation, try Bitwise calculator: AND, OR, XOR and shifts.

What to enter

InputWhat it meansExample value
Signed integerUp to 256 digits; no fractions, prefixes or separators in the input. A minus sign is a sign, not two’s complement.255
Input baseRadix used to read the input digits. For example, base 16 accepts A through F. Input base: 2…3610
Output baseRadix in which to write the converted value. Output base: 2…3616
Digit groupingDigit grouping: None / 4 / 84

How the calculation works

  1. Convert a signed integer between bases 2–36. Choose the input base, output base and digit grouping; inspect the exact decimal value and place values.
  2. N = s × Σ dᵢ bⁱ; 2 ≤ b ≤ 36
  3. Up to 256 digits; no fractions, prefixes or separators in the input. A minus sign is a sign, not two’s complement.
The formulaN = s × Σ dᵢ bⁱ; 2 ≤ b ≤ 36

A worked example

255₁₀ = FF₁₆ = 11111111₂; 1000₁₀ = 3E8₁₆; 18446744073709551617₁₀ = 10000000000000001₁₆.

Example you can load

What to enter
Result for this example · Converted integerFF

This is a fixed example; changing the form above does not change these numbers.

Assumptions & limits

Up to 256 digits; no fractions, prefixes or separators in the input. A minus sign is a sign, not two’s complement.

Frequently asked questions

Input base?

Convert a signed integer between bases 2–36. Choose the input base, output base and digit grouping; inspect the exact decimal value and place values.

Digit grouping?

N = s × Σ dᵢ bⁱ; 2 ≤ b ≤ 36

Signed integer?

Up to 256 digits; no fractions, prefixes or separators in the input. A minus sign is a sign, not two’s complement.