Skip to main content

Grades 6-12Free, no account needed

Integer base converter

Convert signed integers between bases 2 through 36, with exact place values, repeated division and a target-digit check.

All calculators

Try your problem

1-32 digits, optional sign; A-Z mean 10-35. No 0x prefix.
Integer from 2 through 36.
Integer from 2 through 36. Paste: base(-2F;16;2).

Your calculations stay in this browser. No input history is saved.

Supported inputs and limits

Signed integer numerals only: 1-32 alphanumeric digits plus optional leading sign, bases 2-36. Lowercase letters are accepted and output is uppercase; leading zeros, a leading plus and negative zero are canonicalized. No prefixes, separators, decimal points or fractional values. Exact BigInt arithmetic; output may contain up to 166 binary digits. The exact table includes all source places and every target division. Bars show digit coefficients, not weighted magnitudes. Paste base(-2F;16;2), at most 200 characters with semicolon arguments.

Understand the method

Hexadecimal 2F uses digit coefficients 2 and 15 at powers 1 and 0: 2 times 16 plus 15 equals decimal 47 and binary 101111.

A base tells you how each position grows. In base b, the rightmost digit multiplies b^0 = 1, the next multiplies b^1, then b^2, and so on. Digits must be smaller than the base. Letters A through Z stand for digit values 10 through 35, so hexadecimal F means 15, not an unknown variable.

To convert an integer, first expand its source digits into an exact decimal value. Divide its magnitude repeatedly by the target base. Each remainder is a digit, starting at the units position; read the remainders in reverse order. Restore a negative sign only for a nonzero result. Decode the new digits again to verify the same signed value.

Worked examples

Read the reasoning, or load an example into the calculator.

Hexadecimal places become binary

2F in base 16 is 2*16 + 15 = 47. Its target-base remainders give 101111 in base 2, which decodes to 32+8+4+2+1 = 47.

Preserve a negative integer

-1011 in base 2 has magnitude 8+2+1 = 11. Base 8 writes 11 as 13, so the signed output is -13.

Canonical zero

-0000 in base 36 is the integer zero. Its base-10 output is 0, not -0; the leading zeros and unnecessary sign are removed.

Try it without the calculator

Three questions for practice, not a graded school assessment. Your answers stay on this page and are not saved.

1. What decimal value does binary 1101 represent?
2. Which numeral is invalid in base 8?
3. Why are target-base division remainders read backward?

Original Testinar learning content. This local preview is awaiting final review before publication.

Page UP