CT Calc Tools

Number Base Converter

Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36 instantly. Free and private.

๐Ÿ”’ Runs entirely in your browser โ€” nothing is uploaded

Binary (2)

Octal (8)

Decimal (10)

Hexadecimal (16)

Base 36

Advertisement

What is a number base?

A number base (or radix) is how many distinct digits a numbering system uses. Everyday counting is decimal, base 10, with digits 0 to 9. Computers use binary, base 2, with only 0 and 1. Programmers also use octal (base 8) and hexadecimal (base 16, digits 0โ€“9 and Aโ€“F) because they map neatly onto groups of bits: one hex digit represents four bits and one octal digit represents three. This tool converts between these bases and any custom base up to 36, where letters A to Z represent the values 10 to 35.

How base conversion works

Each digit in a number is multiplied by the base raised to its position. In binary 1101 is 1ร—8 + 1ร—4 + 0ร—2 + 1ร—1 = 13. To go the other way, divide repeatedly by the target base and read the remainders from last to first: 13 รท 2 gives remainders 1, 0, 1, 1, which read backward give 1101. Hexadecimal FF equals 15ร—16 + 15 = 255, and decimal 255 is 11111111 in binary and 377 in octal. The converter performs these steps for you using arbitrary-precision integers, so very long values stay exact.

Where base conversion is useful

Developers use hex for colors, memory addresses and byte values, binary for bit masks and flags, and octal for Unix file permissions such as 755. Base 36 is handy for short IDs, and base 32 or 64 style encodings build on the same idea. You can type negative numbers with a leading minus, and spaces or underscores are ignored, so grouped values such as 1111_0000 work. Everything is computed locally in your browser, so nothing you enter is uploaded.

Tip: to check a result, convert it back to the original base and confirm you get the same number. Remember that hexadecimal letters are not case sensitive, and that a leading zero never changes a value, so 0007 and 7 are identical in every base.

How to use

  1. Type a numberEnter the value you want to convert, such as 255, 11111111 or FF.
  2. Choose its baseSelect binary, octal, decimal, hexadecimal, or a custom base from 2 to 36.
  3. Read all conversionsThe number is shown in binary, octal, decimal, hexadecimal and your custom base at once.

Frequently asked questions

How do I convert binary to decimal?
Choose Binary as the source base and type the bits. Each position is a power of two, so 1010 is 8 + 2 = 10.
Can I use 0x or 0b prefixes?
Yes. Prefixes 0x, 0b and 0o are accepted when they match the selected base.
Is there a size limit?
No practical limit. The converter uses big integers, so long values are exact.
Which digits are allowed in base 36?
Digits 0โ€“9 and letters Aโ€“Z, case-insensitive.
Advertisement