Developer Bases

Number base converter

Value
From base
To base
Converted 255
Base 16 → base 10
And every common base
Decimal 255
Binary 11111111
Octal 377
Hexadecimal FF
Base 32 7V
Base 36 73
Bits needed 8
Note
Bases 2 to 36 · digits 0–9 then A–Z
DecimalBinaryOctalHex
0000
1111
81000108
10101012A
15111117F
16100002010
64100000010040
100110010014464
25511111111377FF
256100000000400100
1024100000000002000400
655351111111111111111177777FFFF

Base 36 uses all ten numerals and all twenty-six letters, which is as far as a case-insensitive alphanumeric alphabet goes. Base 62 exists by distinguishing upper and lower case, and Base64 adds two symbols on top, but those are encodings for binary data rather than positional number systems, which is why the general converter stops at 36.

A positional base writes a number with digits worth successive powers of that base. This converts between any two from 2 to 36 in either direction, with the common pairs one pick away: FF in base 16 is 255 in decimal, 11111111 in binary, 377 in octal and 73 in base 36.

How to convert between bases

1 For a familiar pair, choose common pairs and pick binary, octal, decimal or hexadecimal on each side.
2 For anything else, choose any base and type the two radixes, from 2 up to 36.
3 Enter the value. A digit the source base cannot hold is named as an error rather than skipped.
4 Read the result, plus decimal, binary, octal, hex and the rest underneath.
5 For text rather than a number, choose character codes and pick a direction: it writes each character as its code point in the base you pick, and reads the codes back.

Converting between two arbitrary bases is done by going through decimal, which is what this tool does internally. The exception is when one base is a power of the other, as in hex to binary or octal to binary, where direct digit substitution works and needs no arithmetic. That shortcut is why those particular pairs feel so much easier than, say, base 7 to base 13, and it is the whole reason hexadecimal exists in computing: one hex digit holds exactly four bits, so a register value or a memory dump can be read either way round without calculation.

Going from binary back up, the padding direction is the mistake worth avoiding. Bits carry value by position from the right, so a group of fewer than four must be padded on the left. 110110 padded on the left is 0011 0110, which is 36 in hex and 54 in decimal; padded on the right it would be D8, or 216, four times too large because every bit has been shoved two places up. The grouped binary row shows where the nibbles actually fell. Leading zeros are not printed on the way out, so pad the result yourself where a fixed width matters.

Octal is the same trick with three bits per digit, and it survives mainly in Unix file permissions, where that grouping is genuinely the clearest notation available. 755 is 111 101 101, full permissions for the owner and read and execute for everyone else, and in decimal it would be 493, which tells you nothing. The trap is the leading zero: in C a bare 0755 means octal, while Python 3 and strict-mode JavaScript reject it and want 0o755. Passing the decimal 755 where octal was expected sets 1363 instead, a permission set nobody intended.

Base 36 is where the compactness argument lives: 1234567890 becomes KF12OI, ten digits down to six, which is why short identifiers and URL slugs are often generated this way. The row labelled base 32 is a positional base in the same family, using 0–9 then A–V. It is not RFC 4648 Base32, and neither is it Base64. Those encode arbitrary bytes using a chosen alphabet, which is a different job from writing a number in a base.

Character codes are the same idea pointed at text instead of a number. Every character has a code point, and writing that number in a base is exactly what the rest of this page does — so ‘Hello’ in base 16 is 48 65 6C 6C 6F, and in base 10 it is 72 101 108 108 111. The codes are padded to a fixed width only where the base divides a byte evenly: two digits in hex, eight in binary, none in octal or decimal, because 8 and 10 do not. What it reads back are code points and not UTF-16 units, so an emoji survives the round trip as one code rather than two halves: 🎉 is 1F389, not D83C DF89. A code the base cannot hold is named rather than skipped.

One honest limit: the arithmetic runs in double-precision floating point, so values above 9007199254740991 stop being exact. Below that everything here is exact in every base. Fractions are refused rather than truncated, and a leading minus sign is understood.

What people use it for

  • Working with an unusual base
  • Reading a register or bitmask as bits
  • Compressing a long bitmask into hex
  • Reading a chmod value
  • Producing a chmod value from a decimal number
  • Following a hardware or register datasheet written in hex
  • Generating short identifiers in base 36
  • Converting between several bases at once
  • Checking a conversion you did by hand
  • Course work on number systems
  • Turning a string into hex character codes
  • Reading hex character codes back as text

Questions

Anything from 2 to 36. Base 36 uses 0–9 then A–Z.

Was this tool any good?
Internal signal only · I use it to find the tools worth rebuilding