Number Base Converter
Convert numbers between binary, octal, decimal, hexadecimal, and any custom base.
Number Base Converter tool
Example
Input: Decimal number 255 (from base 10)
Result: Binary 11111111, octal 377, hexadecimal FF
255 = 2^8 - 1, which is eight 1 bits; 255 = 15 x 16 + 15 = FF in hex, and 3 x 64 + 7 x 8 + 7 = 377 in octal.
Decimal, Binary, Octal and Hex
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 42 | 101010 | 52 | 2A |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 127 | 1111111 | 177 | 7F |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1000 | 1111101000 | 1750 | 3E8 |
| 65535 | 1111111111111111 | 177777 | FFFF |
- Select the input base: binary (2), octal (8), decimal (10), hexadecimal (16), or any base from 2 to 36.
- Enter your whole number using valid digits for the selected base.
- View the number converted to all four common bases simultaneously, plus grouped binary (4-digit clusters) and hex (pairs).
- Enter a custom base from 2 to 36 to see the number in that base as well.
- Click the copy button next to any base conversion to copy it.
Binary, Octal, Decimal and Hex Explained
A number base is how many digits a counting system uses before it carries over. Decimal uses 10, binary uses 2 and hexadecimal uses 16. So 255 in decimal is 11111111 in binary and FF in hex. This converter takes a whole number in any base from 2 to 36. It shows the number in binary, octal, decimal, hex and a custom base of your choice.
Every base works on place value. Each position is worth the base times the position to its right. In binary, 1101 means 8 + 4 + 0 + 1 = 13. Hexadecimal needs six extra digits, so it uses A to F for 10 to 15. Bases above 16 carry on through the alphabet, up to Z for 35 in base 36.
Programmers use hex because one hex digit is exactly four binary digits. Two hex digits make one byte, so FF is 11111111. The tool also shows binary in groups of four and hex in pairs to make long values easier to read. Octal still appears in Unix file permissions such as 755, which the Chmod Calculator explains. Web colors such as #FF8800 are three hex bytes, which the Hex to RGB Converter splits apart.
Input is forgiving. Letters can be upper or lower case, and spaces and underscores are ignored. The prefixes 0x, 0b and 0o work for hex, binary and octal. The converter uses exact big-number math, so very long values convert with no rounding.
There are two limits. Only whole numbers are supported, not fractions. Negative numbers simply keep their minus sign, so -5 becomes -101. That is not the two's complement bit pattern a computer uses to store negative values.
Formula / How It Works
Frequently Asked Questions
Related Tools
Roman Numeral Converter
Convert between Roman numerals and Arabic (decimal) numbers in both directions.
Math and NumbersScientific Notation Converter
Convert between standard numbers and scientific notation with E-notation support.
Math and NumbersHash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text or files right in your browser.
Developer ToolsHex to RGB Converter
Convert hexadecimal color codes to RGB values instantly. Supports shorthand and 8-digit hex with alpha.
Color Tools