Decimal to binary, octal and hex
- Input
- 222
- Expected output
- binário 11011110, octal 336, hexadecimal DE
All three results represent the same value; summing each one's place values returns 222 in every case, only the bit-grouping base changes.
number base conversion
Every number has a representation in any base greater than or equal to 2: the value never changes, only how it is written. This page walks through both directions, successive division to convert into a new base and place-value summation to return to base 10, with the full steps shown.
All three results represent the same value; summing each one's place values returns 222 in every case, only the bit-grouping base changes.
FF is the largest possible 1-byte value because each hex digit F equals 15 (1111 in binary); two consecutive Fs fill all 8 bits, with no position left over.
Base 36 uses the 10 digits plus the 26 letters of the alphabet as symbols; R is worth 27 and S is worth 28 in that notation, and 27×36¹+28×36⁰ = 972+28 = 1000, the base ceiling the converter accepts.
Converting a number between bases means representing the same value using a different set of digits. A decimal (base 10) number can be expressed exactly in binary (base 2), hexadecimal (base 16), or any other base.
Because a transistor has two stable electrical states, on and off, which map directly to 0 and 1; representing ten symbols would require reliably distinguishing ten voltage levels, which is more expensive and more error-prone to read than just two.
Because each hex digit covers exactly 4 bits (2⁴=16), so 2 digits close out 1 byte with nothing left over; a 6-byte MAC address becomes 12 hex digits grouped in pairs (e.g. 00:1A:2B:3C:4D:5E), far shorter than the 48 equivalent binary digits.
The sign is handled outside the positional representation: the converter separates the sign from the absolute value, converts the absolute value normally and reapplies the sign to the final result; there is no two's complement in this tool, the technique hardware actually uses internally to represent negatives in fixed-width binary.
Yes: the converter accepts base 2 through base 36 because that range exhausts the unambiguous symbols available in ASCII, 10 digits (0-9) plus 26 letters (A-Z); a base 37 would require inventing a new symbol, something no standard notation does.
All data stays in your browser. No numbers are sent to any server.