Binary Hex Decimal Converter - Base 2, 8, 10 & 16 Tool
This Binary Hex Decimal Converter transforms numbers between base 2, 8, 10, and 16 with digit validation and nibble-grouped binary display. Enter a value in any supported base - with optional 0b, 0o, or 0x prefixes - and copy all four representations plus spaced binary for readability.
Input
Digit rules
- Binary: 0-1 (prefix 0b)
- Octal: 0-7 (prefix 0o)
- Decimal: 0-9
- Hex: 0-9, A-F (prefix 0x)
Multi-base conversion method
All conversions route through an arbitrary-precision integer (BigInt) in decimal. Input digits are validated per base, parsed to decimal, then formatted to binary, octal, and hex strings. This avoids floating-point rounding errors that plague JavaScript parseInt on very large values.
Value-specific pages: 255, 1024, 0xFF, and 0xff prefixed.
Number Base FAQ
How do I convert decimal 255 to hexadecimal?
Divide 255 by 16: 255 ÷ 16 = 15 remainder 15. Both remainders are F in hex, so 255 = 0xFF. In binary that is 1111 1111 - eight set bits, the maximum unsigned byte. This converter shows all bases simultaneously so you can verify firmware constants and color channel values.
What is binary 11111111 in decimal and hex?
Eight consecutive 1-bits equal 2⁸ − 1 = 255 decimal and 0xFF hexadecimal. It is the top of an 8-bit unsigned integer range (0-255). Network masks, RGB channels, and bitmask flags often use this value. The tool groups binary in nibbles (4 bits) for easier reading.
How do I convert hex to binary?
Map each hex digit to four binary bits: F = 1111, A = 1010, 5 = 0101. Concatenate without spaces first, then group by nibbles. 0xA5 becomes 1010 0101. This calculator accepts 0x-prefixed hex and outputs spaced binary automatically - useful when debugging hardware registers or opcode dumps.
What digits are valid in each number base?
Binary allows 0-1. Octal allows 0-7. Decimal allows 0-9. Hexadecimal allows 0-9 and A-F (case insensitive). Invalid characters trigger an inline error instead of silent wrong answers. Prefixes 0b, 0o, and 0x are stripped before validation, matching JavaScript and Rust literal syntax.
Binary hex converter vs programmer calculator app: which is better?
Hardware calculator apps excel at chained arithmetic across bases. This web converter is better for quick copy-paste during code review, documentation, and classroom work - all four outputs appear at once with prefixed octal and hex strings ready for source code.
Why group binary digits in groups of four?
Each hex digit represents exactly four binary bits (one nibble). Grouping binary as 1111 1111 mirrors 0xFF and makes manual cross-checking faster. Assembly listings, networking cheat sheets, and hardware datasheets use the same nibble convention.
Sources & review
Last reviewed:
Related Dev Tools
- Aspect Ratio Calculator Resize width and height while locking common video and image ratios.
- Chmod Calculator Convert file permissions between octal and symbolic chmod notation.
- Unix Timestamp Converter Convert Unix epoch seconds or milliseconds to human-readable dates.
- Download Time Calculator Estimate download or upload time from file size and connection speed.