Math & Algebra Calculators

Number Base Converter

Convert non-negative safe integers between bases 2 and 36 or display decimal, binary, octal, hexadecimal, base32, and numeric base64 forms.

Number Base Converter — Online Calculator

Number Base Converter

Edit any base to update all six representations.

Decimal 255 = binary 11111111 = hex FF.

Base 64 here is numeric radix-64 using 0-9, A-Z, a-z, + and /. It is not Base64 byte encoding.

The Number Base Converter converts non-negative integers between any bases from 2 to 36, with strict digit checking, and offers an all-bases view showing decimal, binary, octal, hexadecimal, base 32, and the numeric base-64 form side by side. Enter the value, its current base, and the base you want.

How It Works

Every character of the input is validated against the source base's digit set (0 to 9, then A to Z for values 10 to 35, case-insensitively); a single out-of-base digit rejects the input with an error rather than guessing. The validated number is parsed into a decimal integer, then re-expressed in the target base. Only safe integers are accepted (up to 2^53 - 1), because beyond that a JavaScript number cannot represent every integer exactly, and a converter that silently changes your number is worse than one that refuses it.

The bases you will actually meet

| Base | Name | Where it lives | |---|---|---| | 2 | Binary | Machine values, bit flags, permissions bits | | 8 | Octal | Unix file permissions (755), older systems | | 10 | Decimal | Human counting | | 16 | Hexadecimal | Colors (#FF5733), memory, hashes, bytes | | 32 | Base 32 | Encoded keys and identifiers | | 36 | Base 36 | Short IDs and tokens (0-9 plus all letters) |

Worked examples

Binary 1010 converts to decimal 10, octal 12, and hexadecimal A. Decimal 255 converts to hexadecimal FF, binary 11111111, and octal 377, which is why 255 appears everywhere in computing as the largest byte value. Hexadecimal 1F4 converts back to decimal 500. In base 36, decimal 35 is the single digit Z and 36 becomes 10, the rollover that makes base 36 so compact for short codes: a six-character base-36 string covers over two billion values.

Place value, once and for all

Every base is the same idea: each position is worth the base raised to its position index, and digits count how many of that value to include. 1010 in binary is 1x8 + 0x4 + 1x2 + 0x1 = 10. FF in hexadecimal is 15x16 + 15 = 255. Converting by hand through decimal (evaluate the source by place value, then divide repeatedly by the target base collecting remainders) always works and is exactly what this tool automates; reaching for it on a four-digit hex color channel or a permission mask is faster and less error-prone than mental division.

The base-64 note

The all-bases view's base-64 entry is a numeric representation using the digit alphabet 0-9, A-Z, a-z, +, /, meaning the number written positionally in base 64. It is not the Base64 encoding used for binary data in email and data URLs (that encodes bytes three at a time into four characters, with padding). Confusing the two produces gibberish in both directions; use a dedicated Base64 encoder for byte data.

Limitations

Integers only: no fractions, no negatives, and no values beyond the safe-integer range. Digit validation is strict, so inputs containing spaces, prefixes such as 0x or 0b, or digits outside the source base are rejected rather than trimmed; strip prefixes before converting.

Quick mental anchors worth memorizing

A few fixed points make base work faster everywhere: 10 in binary is 2, 100 is 4, 1000 is 8, and 11111111 is 255; in hex, A is 10, F is 15, 10 is 16, and FF is 255; octal 10 is 8 and 777 is 511. With those anchors you can estimate unfamiliar values before converting them exactly here, which catches the most dangerous conversion error of all: a plausible-looking answer in the wrong base, such as reading the hex value 20 (thirty-two) as twenty. Programmers meet that trap in color codes and byte offsets weekly; the two-second estimate is the professional habit.

Frequently Asked Questions

Why was my value rejected as invalid?

It contains a character that is not a digit of the source base (for example a 2 in a binary value, or G in hexadecimal), or it exceeds the safe integer limit. The error is deliberate: guessing would corrupt the conversion.

What letters does base 36 use?

All of them: digits 0 to 9 then A to Z for values 10 through 35. Input is case-insensitive and output is uppercase.

Can I convert fractions like 0.1?

Not with this tool. Fractional conversion needs a different algorithm and a rounding decision (many decimal fractions have no finite binary form), so the converter restricts itself to exact integers.

Related Tools