Everyday numbers are decimal, but computers store them in binary, programmers abbreviate them in hexadecimal, and older Unix traditions still speak octal. This converter takes an ordinary base-ten number and rewrites it in all three systems at once, which is the quickest way to check coursework, prepare a value for code, or confirm that the figure in a permissions mask or colour code is the one you intended.
Quick Answer
A decimal number converts by repeated division: divide by the target base, record each remainder, and read the remainders in reverse. The worked example below shows 2024ββ = 11111101000β = 7E8ββ = 3750β. Equivalently, binary falls out of splitting the number into powers of two, and each group of four binary digits is one hexadecimal digit.
One Number, Four Notations
A number system is just a choice of how many symbols to cycle through before carrying. Decimal cycles through ten digits and carries into a tens column. Binary cycles through two β each column is a power of two. Octal cycles through eight and hexadecimal through sixteen, which is why hex needs six extra symbols and borrows the letters A to F for the values ten to fifteen.
The value of a number never changes across these notations; only the spelling does. 2024 is about two thousand in any of them, and if a conversion produces something wildly different in size, a digit has gone astray. What changes is convenience. Binary shows the machine's view β which bits are set. Hexadecimal compresses that view four-to-one, which is why memory addresses, colour values and error codes wear hex. Octal compresses three-to-one and survives mainly in Unix file permissions, where the three permission groups of three bits map to it perfectly.
Two methods do all the work. Repeated division by the base, collecting remainders, converts decimal to any base mechanically and suits hand calculation in octal and hex. The subtraction method suits binary: list the powers of two up to your number, take the largest that fits, subtract, and continue β every power you used becomes a 1, every power you skipped a 0. The converter runs both instantly, but knowing them is what lets you spot a wrong answer at a glance.
How to Use the Decimal Converter
- Enter the decimal number as a plain integer β the value you would write in ordinary arithmetic.
- Read the binary form when you need the bit pattern: which powers of two are present, and how wide the number is in bits.
- Read the hexadecimal form for compact notation, remembering that letters AβF are digits here, not labels.
- Read the octal form for permissions-style values and legacy contexts.
- Sanity-check by size: the binary version should have one more digit than the highest power of two in the number, and the hex version about a quarter as many digits as the binary.
- Copy the exact form you need, keeping any leading zeros your context requires β a byte written as 8 bits and the same value written as 4 are not interchangeable in code.
Worked Example: Converting 2024
Convert 2024 by the subtraction method for binary. Powers of two up to it: 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1. Take 1024 (remainder 1000), 512 (488), 256 (232), 128 (104), 64 (40), 32 (8), skip 16, take 8 (0), skip 4, 2 and 1. The used powers β 1024, 512, 256, 128, 64, 32 and 8 β give 11111101000β. Group those bits in fours from the right: 0111 1110 1000 β 7, E, 8 β 7E8ββ, confirmed by arithmetic: 7Γ256 + 14Γ16 + 8 = 1792 + 224 + 8 = 2024. Group in threes: 011 111 101 000 β 3, 7, 5, 0 β 3750β, and again: 3Γ512 + 7Γ64 + 5Γ8 = 1536 + 448 + 40 = 2024. Three spellings, each independently verified.
Where Decimal Conversions Slip
Remainders read in the wrong order are the classic division-method error β the first remainder is the last digit, not the first, and reversing the string is not optional. In hex, forgetting that AβF carry values ten to fifteen corrupts any check-by-arithmetic; E is fourteen, never a label for "error". Another trap is assuming leading zeros are always safe to drop: in programming languages a leading zero can reclassify a literal as octal in older syntax, and in fixed-width data an 8-bit value padded to 16 bits is a different field.
Negative and fractional numbers sit outside what a plain integer conversion claims to do. Real systems encode negatives in two's complement and fractions in floating-point formats, both of which are representations with their own rules rather than direct translations. If a tool or a textbook shows β5 as a long string of ones and a final pattern, that is two's complement at work, not a misprint.
File permissions are where all three target systems meet in one daily task, and they make a tidy test of everything above. A Unix permission set written as rwxr-xr-x is, group by group, 111 101 101 in binary β 7, 5 and 5 β so the octal form is 755. The same permission as a single decimal number is 493, because 7Γ64 + 5Γ8 + 5 = 448 + 40 + 5. Feed 493 into this converter and it returns the whole family at once: binary 111101101, octal 755, and hexadecimal 1ED (1Γ256 + 14Γ16 + 13 = 256 + 224 + 13 = 493). Administrators think in the octal, the kernel stores the bits, and the decimal appears in documentation β three spellings of one fact, each verifiable against the others in seconds.
Working in the Other Directions
When the starting point is a string of bits rather than a decimal figure, the Binary Converter decodes it into decimal, hex and octal, and the Hex Converter handles the base-sixteen direction, including the colour-code arithmetic designers use daily. The whole family of unit and number tools sits in the converters section.