How this instrument works
Binary and hexadecimal are both positional numeral systems, exactly like the familiar base-10 you already use, just with a different number of symbols per place: binary has two (0 and 1), hexadecimal has sixteen (0 through 9, then A through F standing for ten through fifteen). This calculator takes a single decimal number and shows both representations side by side, because there is no way to type raw binary digits such as 1010 into an ordinary numeric field without the software reading it as the decimal number one thousand and ten — decimal-in, both-bases-out is the only input design that cannot be silently misread.
Positional binary arithmetic was worked out in full by Gottfried Wilhelm Leibniz, who drafted a private manuscript on it in 1679 (not published in his lifetime) and then published Explication de l'Arithmétique Binaire in 1703, intrigued by how the two-symbol hexagrams of the Chinese I Ching seemed to encode the same logic. Binary stayed a mathematical curiosity for nearly two centuries until George Boole's 1854 algebra of logic and then Claude Shannon's 1937 master's thesis showed that on/off switching circuits could carry out that same two-valued logic directly, which is the reason every modern processor still counts in nothing but 0s and 1s at the hardware level.
Hexadecimal became the standard shorthand for binary once computer memory settled on the 8-bit byte, because eight divides evenly into two groups of four while it does not divide evenly into groups of three — octal, base 8, had briefly served the same shorthand role on earlier machines such as the 12-bit-word PDP-8, where three-bit groups fit cleanly. IBM's System/360 family, launched in 1964, was among the first major computer lines to standardize on hexadecimal notation for an 8-bit-byte architecture, and hex has been the working notation for memory dumps and machine code ever since.
That same four-bits-per-digit rule is why hexadecimal now shows up wherever raw binary needs a compact, human-readable face: web colour codes such as #CA0000, memory addresses in a debugger, MAC and IPv6 addresses, and the U+ code points that label every character in the Unicode standard are all hexadecimal precisely because each pair of hex digits packs one full byte — eight bits — into two characters instead of eight.
- Type a whole decimal number into the Decimal value field (x); it comes preloaded at 202 so you can see the conversion happen immediately.
- Read the Binary representation line underneath for that same value written with only 0s and 1s, recalculated on every keystroke.
- Read the Hexadecimal representation line alongside it for the same value written in base 16, using digits 0 through 9 and letters A through F.
- There is no box for typing binary digits, on purpose: entering 1010 into a number field would be read as decimal one thousand ten, not binary ten, so decimal-in with both bases as output avoids that misreading.
- Only whole numbers of zero or more are accepted, since place-value notation for negative numbers is not standardized the same way across bases.
Worked example — decimal 202 in binary and hexadecimal
Take x = 202. Dividing by 2 repeatedly and reading the remainders from bottom to top gives the binary digits: 202÷2=101 r0, 101÷2=50 r1, 50÷2=25 r0, 25÷2=12 r1, 12÷2=6 r0, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1. Read bottom-up, those remainders are 11001010 — the Binary representation field. Dividing 202 by 16 instead gives 12 remainder 10, then 12÷16=0 remainder 12; remainder 10 is the hex digit A and remainder 12 is the hex digit C, so read bottom-up that is CA — the Hexadecimal representation field.
Group that same binary string 11001010 into 4-bit chunks counting from the right: 1100 and 1010. The first chunk, 1100, is 8+4=12 in decimal, which is the hex digit C; the second chunk, 1010, is 8+2=10 in decimal, which is the hex digit A. Reading the chunks left to right gives CA again, matching the division method exactly and showing why hexadecimal is really just binary regrouped four bits at a time. The same shortcut turns 15, whose binary form is 1111, straight into the single hex digit F — the largest value one hex digit can hold.
Questions
Why can't I just type binary digits like 1010 into the field?
Because a plain numeric input field has no way to know you mean the binary pattern for ten rather than the decimal number one thousand and ten — both are written '1010'. Typing raw binary digits into a decimal field would silently produce a wrong answer with no error message, which is worse than not allowing it. Entering a decimal value and reading both the binary and hexadecimal representations as output sidesteps that ambiguity entirely: there is only one way to type '202', and both target bases are computed from that unambiguous number.
Why does hexadecimal use letters A through F?
Base 16 needs sixteen distinct symbols per digit position, and the familiar 0-9 supplies only ten of them. Rather than invent new symbols, hexadecimal borrows the first six letters of the alphabet, so A stands for ten, B for eleven, C for twelve, D for thirteen, E for fourteen and F for fifteen — the same convention IBM helped popularize when it standardized hex notation for the System/360 in 1964, and every processor architecture, assembler and debugger has used it since.
Why is hexadecimal used instead of just writing out the binary?
Because 16 is 2 to the 4th power, every group of exactly 4 binary bits corresponds to exactly one hex digit with nothing left over — no other common base lines up with binary that cleanly (octal, base 8, needs groups of 3 bits, which does not divide evenly into an 8-bit byte). That means an 8-bit byte always becomes exactly 2 hex digits and a 32-bit value always becomes exactly 8, so hex compresses long strings of 0s and 1s into something a person can read and type without losing the exact bit pattern underneath.
What's the difference between binary, octal, and hexadecimal?
All three are positional numeral systems for the same decimal number, differing only in how many symbols each digit position can hold: binary uses 2 (0-1), octal uses 8 (0-7), and hexadecimal uses 16 (0-9 then A-F). Octal was common on early machines with word sizes divisible by 3 bits, such as the 12-bit PDP-8, while hexadecimal took over once 8-bit bytes and word sizes divisible by 4 became standard from the 1964 IBM System/360 onward, because hex maps onto binary bytes without any remainder.
How do I convert a decimal number to binary and hex by hand?
Divide by the target base repeatedly, writing down each remainder, and stop once the quotient reaches zero; reading the remainders from the last one back to the first gives the digits in the correct order. For 202, dividing by 2 eight times in a row gives remainders that read 11001010, and dividing by 16 twice gives remainders that read CA — the exact figures this calculator returns for that input. A quicker route to hex once you already have the binary is to split it into 4-bit groups from the right and convert each group on its own.
Does the calculator accept negative numbers or fractional values?
No — only whole numbers of zero or more. Fractional values can be represented in binary or hex using a radix point, but the notation and rounding rules differ enough from whole-number place value to need a separate calculator built for that purpose, and negative numbers in binary depend on a chosen bit width and encoding scheme, such as two's complement, that is not a single universal answer the way whole-number conversion is.
Who invented binary numbers?
Gottfried Wilhelm Leibniz worked out positional binary arithmetic in a 1679 manuscript and published it formally in 1703, partly inspired by correspondence about the two-symbol hexagrams of the Chinese I Ching. It remained a mathematical curiosity until George Boole's 1854 logic algebra and Claude Shannon's 1937 thesis on relay switching circuits showed that binary's two values map directly onto an electrical switch being on or off, which is why every digital computer since has been built to count in binary at the hardware level.