Binary / Decimal / Hex Converter
Enter a non-negative integer and its base to instantly see it converted to binary, octal, decimal, and hexadecimal.
Binary
—Octal
—Decimal
—Hexadecimal
—Examples
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 10 | 1010 | 12 | A |
| 255 | 11111111 | 377 | FF |
| 4096 | 1000000000000 | 10000 | 1000 |
Formula & Methodology
Each base represents numbers using a different number of digit symbols (its "radix"):
binary = base 2 (0–1) · octal = base 8 (0–7) · decimal = base 10 (0–9) · hex = base 16 (0–9, A–F)How to Use
- Choose the base your input value is written in (or leave it on Auto-detect).
- Type the value.
- All four representations update instantly below.
Frequently Asked Questions
Does this support negative numbers?
No — this tool currently supports non-negative integers only. Negative number and fractional support may be added in a future update.
How large a number can I convert?
The tool uses JavaScript’s BigInt internally, so it can handle arbitrarily large integers without losing precision — unlike using regular floating-point numbers.
What does "Auto-detect" do?
It guesses the base from the format of what you typed — a 0x prefix is treated as hex, 0b as binary, 0o as octal, and plain digits are treated as binary if they only contain 0s and 1s, otherwise decimal.
Last updated: