What the page converts

Enter a whole number written in any base from 2 to 36, say which base it uses, and choose the base you want back. Binary, octal, decimal and hexadecimal are the usual choices, but every base up to 36 works, using the digits 0 to 9 and then the letters A to Z for the values 10 to 35. Input letters are accepted in upper or lower case, and the output uses capitals. The default converts FF from base 16 to base 2 and returns 11111111. Programmers, electronics students and anyone reading memory dumps, color codes or permission bits can use it to move between the notations without long division on paper.

How the arithmetic works

Parsing uses the positional rule. Starting with zero, each digit multiplies the running total by the source base and adds the digit value. FF in base 16 goes 0 × 16 + 15 = 15, then 15 × 16 + 15 = 255. Formatting is the reverse: divide by the target base repeatedly and collect the remainders from last to first. 255 in base 2 gives eight ones, which is 11111111. Because the page works with arbitrary-precision integers (JavaScript BigInt), there is no rounding for large values. Numbers that would overflow a 64-bit integer or lose digits in a spreadsheet convert correctly, up to the limit of 4,096 digits in the input.

Reference conversions

A few results are worth knowing. 255 in decimal is FF in hex and 11111111 in binary. 1010 in binary is 10 in decimal. 777 in octal is 511 in decimal, the value behind the Unix permission mode that grants read, write and execute to everyone. 1F4 in hex is 500. DEADBEEF in hex is 3735928559 in decimal, and 7FFFFFFF is 2147483647, the largest signed 32-bit integer. In base 36, ZZ is 1295 because 35 × 36 + 35 = 1295, and decimal 1000 becomes RS. If a conversion of your own data disagrees with one of these patterns, check which base you declared for the source. The color FF8000 is a handy practice case: its three byte pairs are 255, 128 and 0, and the whole value is 16,744,448 in decimal, found as 255 × 65,536 + 128 × 256.

Negative numbers and signs

A leading minus sign is carried through, so -255 in base 10 converts to -FF in base 16. This is a signed magnitude notation, the way a number is written on paper, and it differs from two's complement, which is how processors store negative integers in a fixed number of bits. The value -1 stored in 8 bits is 11111111 in two's complement, but this page returns -1 in binary for decimal -1. If you need the bit pattern of a negative number at a given width, add 2 to the power of the width first. For 8 bits, -1 becomes 255, which then converts to 11111111. The same trick for 16 bits adds 65,536, so -2 becomes 65,534 and then FFFE in hexadecimal. Keep the width in a note, because the same pattern means different values at different widths.

What counts as a valid digit

Every digit must be smaller than the source base. In base 2 only 0 and 1 are allowed, so 102 is rejected. In base 8, the digit 8 is invalid. In base 16, the letters A to F are valid, and G is not. The page also rejects spaces, commas, underscores, a decimal point, and prefixes such as 0x, 0b or 0o, so remove those before pasting. Fractions are not supported either, because a fractional part in another base does not always terminate. For instance, one tenth in binary repeats forever. Only whole numbers, with at most 4,096 digits, are converted.

Everyday uses of other bases

Hexadecimal is compact for bytes, because two hex digits cover exactly one byte, so an RGB color such as FF8000 is three bytes: 255, 128 and 0. Memory addresses, MAC addresses and hash values appear in hex for the same reason. Binary shows individual flags and masks, and octal appears mostly in Unix file permissions, where each digit holds three bits. Base 36 is used for short identifiers and URL shorteners because it packs a large number into few characters. Base 32 and base 64 are close relatives used by encodings, but those are different from the positional number bases handled here. Octal digits map to exactly three bits each, so converting 755 to binary is a digit-by-digit job that gives 111101101. Hexadecimal digits map to four bits, which is why grouping binary in fours makes it readable.

A worked example with a large number

Take 2 to the power of 64, which is 18446744073709551616 in decimal. Converting it from base 10 to base 16 gives 10000000000000000, a one followed by sixteen zeros. That tidy pattern is no accident: each hex digit is four bits, and sixty-four bits make sixteen digits, so a power of two with an exponent divisible by four becomes a one followed by zeros. A double-precision floating-point calculator cannot hold that decimal value exactly, but this page can. The result also shows why 64-bit unsigned integers top out at 18446744073709551615, one less than the value you entered.

Entering a number in the wrong source base

The usual error is entering a value in the wrong source base. The text 10 means ten in base 10, two in base 2 and sixteen in base 16, so the declared base matters as much as the digits. Another is confusing the letter O with zero or the letter l with one when copying from a printout. A third is treating a hex string such as 0x1A as if the prefix were part of the number. Leading zeros are harmless and are dropped from the result. If the output looks wrong, convert it back to the original base to confirm the round trip.

Digit counts and fractions in base conversion

The page handles signed whole numbers with up to 4,096 digits and bases from 2 to 36. It does not convert fractions, scientific notation, two's complement bit patterns, floating-point formats such as IEEE 754, or text. Invalid digits for the chosen base raise an error instead of producing a guess. The output uses uppercase letters. The conversion changes only how a number is written, not its value, and it does not interpret the number as a date, an address, a color or a permission set.