Updated · Built and checked by the PlinzoTools team, formulas tested against published sources
Convert a decimal integer to binary, octal, and hexadecimal.
101010
Computers store and process all data in binary (base 2) -- just 0s and 1s -- while humans naturally work in decimal (base 10). This converter translates a decimal number into its binary representation, and shows the same value in octal (base 8) and hexadecimal (base 16) at the same time, since all three are common ways programmers and engineers represent the same underlying binary data.
Enter a non-negative whole number. The result shows the number's binary, octal, and hexadecimal representations simultaneously. This tool handles unsigned, non-negative integers only -- for signed (negative) numbers using two's complement encoding, see the dedicated Two's Complement Calculator.
Binary conversion repeatedly divides the decimal number by 2, recording each remainder (0 or 1), until the number reaches 0 -- reading those remainders in reverse order gives the binary digits. Octal and hexadecimal work the same way, dividing by 8 and 16 respectively.
| Decimal | Binary | Hex |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 8 | 1000 | 8 |
| 16 | 10000 | 10 |
| 255 | 11111111 | FF |
| 256 | 100000000 | 100 |
Programmers checking bitwise operation results, working with color codes (hex), or debugging low-level data. Computer science students learning number systems and base conversion. Electronics hobbyists working with binary/hex values from microcontroller registers.
This converter handles non-negative integers only -- it doesn't represent negative numbers or fractional/decimal values in binary. For negative numbers in a fixed-bit-width signed representation (the standard way computers store negative integers), use the Two's Complement Calculator instead.
Take decimal 37 and divide repeatedly by 2, noting remainders: 37 ÷ 2 = 18 r 1; 18 ÷ 2 = 9 r 0; 9 ÷ 2 = 4 r 1; 4 ÷ 2 = 2 r 0; 2 ÷ 2 = 1 r 0; 1 ÷ 2 = 0 r 1. Read the remainders from bottom to top: 100101. That matches 32 + 4 + 1 = 37. The tool also reports octal 45 and hex 25 for the same value.
Another example: decimal 200 is 11001000 in binary (128 + 64 + 8), octal 310, and hex C8. Decimal 65 is 1000001, octal 101, and hex 41, which happens to be the ASCII code for the letter A.
An unsigned value fits in n bits when it is less than 2 raised to n. So 255 needs 8 bits, 256 needs 9, and 4,095 (all ones, hex FFF) needs 12. The length of the binary string the tool shows tells you the minimum unsigned width. If you plan to store the value in a fixed-size field, compare the string length with your field width first.
Entering a negative number or a decimal fraction. The tool accepts non-negative whole numbers only, so -5 or 3.5 are rejected. Also avoid commas or spaces inside the number, which are not valid digits.
Another mistake is forgetting that leading zeros vanish. Binary 00000101 and 101 are the same number, and the tool prints 101. A third is confusing hex letters with variables; hex uses A through F for values 10 through 15, and the tool shows them in uppercase.
The tool uses JavaScript numbers, which represent whole numbers exactly only up to 9,007,199,254,740,991. Beyond that, the last digits can be off, so for very large integers such as 64-bit values use a tool or language with big-integer support. This is a limit of the number type, not of the method.
Digital circuits are built from transistors that are most reliably operated in two states (on/off, or 1/0), making binary the natural representation for how computer hardware physically stores and processes information.
They represent the same underlying value, but hexadecimal (base 16) is far more compact to read and write -- one hex digit represents exactly 4 binary digits, which is why hex is commonly used as human-readable shorthand for binary data (like color codes or memory addresses).
No -- this tool is for non-negative integers only. Use the Two's Complement Calculator for signed/negative number representation.
11111111, which is eight ones. In hex it is FF and in octal 377.
Pad the result on the left with zeros until you reach the width you need. The tool does not add padding itself.
Because 10 = 8 + 2, so the bits for 8 and 2 are set and the bits for 4 and 1 are not.
Only within JavaScript's exact integer range, up to 9,007,199,254,740,991. Larger values need a big-integer tool.
Reference: NIST Weights and Measures