Number Base Converter
Convert a whole number between binary, octal, decimal and hexadecimal and see all four at once: 255 is 11111111, 377 and FF. How it works
Use the Number Base Converter
About the Number Base Converter
255 in decimal is 11111111 in binary, 377 in octal and FF in hexadecimal. The number base converter shows a whole number in all four bases at once; each digit counts a power of its base, so 377 in octal is 3 × 64 + 7 × 8 + 7 = 255.
The same numbers in four bases
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 10 | 1010 | 12 | A |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 493 | 111101101 | 755 | 1ED |
| 1000 | 1111101000 | 1750 | 3E8 |
| -10 | -1010 | -12 | -A |
Negative numbers keep a minus sign in every base.
Powers of two in four bases
| Power | Decimal | Octal | Hexadecimal | Binary digits |
|---|---|---|---|---|
| 2⁴ | 16 | 20 | 10 | 5 |
| 2⁸ | 256 | 400 | 100 | 9 |
| 2¹⁰ | 1024 | 2000 | 400 | 11 |
| 2¹⁶ | 65536 | 200000 | 10000 | 17 |
| 2³² | 4294967296 | 40000000000 | 100000000 | 33 |
| 2⁵³ | 9007199254740992 | 400000000000000000 | 20000000000000 | 54 |
| 2⁶⁴ | 18446744073709551616 | 2000000000000000000000 | 10000000000000000 | 65 |
In binary a power of two is 1 followed by zeros. 2⁵³ is where ordinary JavaScript numbers stop holding every whole number; this converter uses BigInt and stays exact up to 4,096 decimal digits.
Frequently asked questions
- How do I convert decimal to binary?
- Divide by 2 again and again and read the remainders from last to first: 10 ÷ 2 = 5 r 0, 5 ÷ 2 = 2 r 1, 2 ÷ 2 = 1 r 0, 1 ÷ 2 = 0 r 1, so 10 is 1010.
- How do I convert binary to hexadecimal?
- Split the binary digits into groups of four from the right and replace each group with one hex digit: 1111 0000 is F0, which is 240. The converter accepts the space between groups and can print binary output in 4-bit groups.
- What is octal used for?
- Mostly Unix file permissions, where each octal digit holds three bits: 755 in octal is 111101101 in binary and 493 in decimal.
- How are negative numbers shown?
- With a minus sign: -10 is -1010 in binary, -12 in octal and -A in hexadecimal. Two’s complement is not offered.
- Can it convert fractions such as 0.5?
- No. A decimal point or comma gets a message that fractions are not supported; only whole numbers are converted.
- Can I type 0x, 0b or lowercase hex?
- Yes, when the prefix matches the From base: 0xff with From set to hexadecimal gives 255, and 0b1010 with binary gives 10. With From set to decimal, 0x1F is rejected because x is not a decimal digit. Hex letters can be upper or lower case; the output uses capitals. One space or underscore between digit groups is accepted, so 1111_0000 in binary gives F0, but two spaces in a row give an error. Values are converted exactly up to 4,096 decimal digits. To get the prefix in the output, tick Show the 0b, 0o or 0x prefix: 255 then shows as 0b11111111, 0o377 and 0xFF.
Related Tools
View all toolsBinary Converter
Convert text to binary and binary back to text in UTF-8: Hello is 01001000 01100101 01101100 01101100 01101111. A second tab converts whole numbers.
Hex to Decimal
Convert hex to decimal, binary or octal with exact whole-number math: FF is 255. Pads hex to 8, 16, 32 or 64 bits and converts 200 lines at once.
Roman Numeral Converter
Convert Roman numerals to numbers and numbers to Roman numerals, from 1 to 3,999,999, with a step breakdown. Spellings such as IIII are refused.
ASCII to Hex Converter
Text to hex and back: ASCII characters become two-digit codes, and é, € or emoji become code points or UTF-8, UTF-16 or Windows-1252 bytes.
Hex to ASCII
Convert hex to ASCII text: 48 65 6C 6C 6F is Hello. Bytes are read as UTF-8, and odd digit counts or bad characters get an error.
Unicode Lookup
Look up any character or code point such as U+1F600: its name, category, script, block and UTF-8, UTF-16 and UTF-32 bytes, or search names and browse blocks.