Binary / Hex / Decimal Converter — Number Base
Convert binary to decimal, hex to decimal, octal, and any base 2–36. Free number base converter in your browser—prefixes 0x, 0b, and 0o supported.
How it works
- Choose decimal, hex, binary, octal, or any base from 2 to 36. Optional prefixes 0x, 0b, and 0o override the selected base. Signed integers within JavaScript’s safe range (±2⁵³−1).
- Decimal
- —
- Hex
- —
- Binary
- —
- Octal
- —
- Selected base
- —
Examples: 255 → FF (hex), 11111111 (binary), 377 (octal). Try 0xff or 0b11111111.
About number bases
Binary, hex, decimal, and octal
A number base converter changes how the same integer is written: binary (base 2), octal (8), decimal (10), hexadecimal (16), or any radix from 2 to 36.
Use it for binary to decimal, hex to decimal, and similar conversions. Prefixes 0b, 0o, and 0x are accepted. Conversion stays in your browser.
Convert bases in code
- JavaScript
parseInt("ff", 16); // 255 (255).toString(2); // "11111111" (255).toString(16); // "ff"- Python
int("ff", 16) # 255 bin(255) # '0b11111111' hex(255) # '0xff'
Number base FAQ
- How do I convert binary to decimal?
- Select Binary (or paste a 0b… value), enter the bits, and read Decimal. Example: 11111111 → 255.
- How do I convert hex to decimal?
- Select Hex or use a 0x prefix. Digits A–F are accepted in either case. Example: 0xFF → 255.
- What bases are supported?
- Any integer base from 2 to 36. Bases above 10 use letters a–z for digits 10–35.