Decimal, Binary, Octal and Hex Converter
Convert an integer between decimal, binary, octal and hexadecimal with no rounding, up to 4,096 bits. Signed negatives, per-result copy and local calculation.
Enter an integer in the base of your choice: its binary, octal, decimal and hexadecimal forms appear immediately, with no rounding or separators.
Input
Enable JavaScript to convert values locally in your browser. The explanations remain available without JavaScript.
Results
Enter an integer: all four conversions appear automatically.
Binary (base 2)
Octal (base 8)
Decimal (base 10)
Hexadecimal (base 16)
Understanding the conversions
Each base writes the same integer with a different alphabet: 0–1 in binary, 0–7 in octal, 0–9 in decimal, and 0–9 then A–F in hexadecimal. Calculations use exact integers, without rounding, up to 4,096 bits.
A negative number is written with a minus sign in all four bases. No two’s complement form is applied, because it depends on a word size. Results contain no prefix, leading zero or separator: the copied value is exactly the one displayed.
The conversion runs entirely locally, without sending or storing the values you enter.
Conversion examples
A few common values, calculated by the same engine as the converter. 65,535 is the highest TCP or UDP port number, and 4,294,967,295 (2^32 − 1) is the largest IPv4 address value.
| Decimal | Hexadecimal | Octal | Binary |
|---|---|---|---|
0 | 0 | 0 | 0 |
10 | A | 12 | 1010 |
42 | 2A | 52 | 101010 |
255 | FF | 377 | 11111111 |
-42 | -2A | -52 | -101010 |
4095 | FFF | 7777 | 111111111111 |
65535 | FFFF | 177777 | 1111111111111111 |
4294967295 | FFFFFFFF | 37777777777 | 11111111111111111111111111111111 |
Frequently asked questions
How do I convert a decimal number to binary?
Choose Decimal (base 10), then enter the integer: all four forms are recalculated as you type. For example, 255 is 11111111 in binary, 377 in octal and FF in hexadecimal. To read the same digits in another base, simply change the input base.
What do the letters A to F mean in hexadecimal?
Base 16 uses sixteen symbols: 0 to 9, then A to F for the values 10 to 15. Each hexadecimal digit maps to four bits: F is 1111, and 2A is 101010, or 42 in decimal. Input accepts small or capital letters; results always use capital letters.
How are negative numbers handled?
The minus sign is kept in all four bases: -42 becomes -101010 in binary and -2A in hexadecimal. The converter does not apply two’s complement, because that form depends on a chosen word size such as 8, 16 or 32 bits. A plus sign is not accepted.
Do very large numbers stay exact?
Yes. Calculations use exact integers up to 4,096 bits, sign excluded, which is 1,234 decimal digits. For example, 9007199254740993 stays exact, whereas floating-point arithmetic would round it. A larger value is rejected with a clear message and never cut short.
Can I type 0x, 0b or 0o before the number?
No. Choose the base from the list and enter digits only: 0x1F is rejected, while 1F in hexadecimal is accepted. Ordinary leading zeros are allowed and never trigger an octal reading. Internal spaces, thousands separators and fractions are rejected.
Is the copied value identical to the one shown, and are my numbers sent anywhere?
Each Copy button places the exact value on the clipboard, without a prefix or separator. If the browser denies access, a message says so and you can select the value manually. The conversion runs locally in your browser: the numbers you enter are neither sent nor stored.
