Math Solver Free

Binary Hex Converter

Convert between binary, octal, decimal, and hex — with steps.

Binary
11111111
Octal
377
Decimal
255
Hexadecimal
FF
Conversion to decimal, step-by-step
  1. 2 x 10^2 = 2 x 100 = 200
  2. 5 x 10^1 = 5 x 10 = 50
  3. 5 x 10^0 = 5 x 1 = 5

Sum = 255 (decimal)

How Number Bases Work

Everyday numbers are base 10 (decimal): each digit is worth ten times the one to its right. This converter moves a number between the four bases used in computing — binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) — and shows all four versions of the value at once, with the place-value working underneath. Computers store everything in binary because a circuit is either on or off, but long binary strings are almost unreadable, so programmers write the same values in hexadecimal, where one digit packs exactly four binary digits.

Place Values: The Rule Behind Every Base

There is no single conversion formula; there is one rule system. In base b, each digit contributes the digit multiplied by b raised to its position, counting positions from 0 at the right. Decimal 253 means 2×10² + 5×10¹ + 3×10⁰ = 200 + 50 + 3. The place values in binary run 1, 2, 4, 8, 16, 32, 64, 128; in octal they run 1, 8, 64, 512; in hexadecimal they run 1, 16, 256, 4096 — and because base 16 needs sixteen digit symbols, the letters A–F stand for the values 10–15. To bring any base back to decimal, expand it exactly this way and add the parts; to leave decimal, divide repeatedly by the target base and read the remainders in reverse. Converting via decimal always works, and binary–hex conversions have a shortcut because 16 is a power of 2.

Converting Between Bases

  • To decimal: multiply each digit by the base raised to its position and add up. Binary 1011 = 1x8 + 0x4 + 1x2 + 1x1 = 11.
  • From decimal: repeatedly divide by the target base and read the remainders backwards.
  • Binary to hex shortcut: group binary digits in fours and convert each group (1010 1111 = AF).

How to Use This Converter

  1. Type your number into the Value box — the tool starts with 255 as a working example.
  2. Choose its current system in the From base dropdown: Binary (base 2), Octal (base 8), Decimal (base 10), or Hexadecimal (base 16).
  3. Read the four result cards — Binary, Octal, Decimal, and Hexadecimal — which all show the same value in different clothing.
  4. Study the working lines below, which expand each of your digits as digit × base^position and sum them into decimal. That expansion is the method to copy into homework. If a digit is not allowed in the chosen base — a 2 in binary, say — the tool flags it rather than guessing.

Worked Example 1: Decimal 173 in Binary and Hexadecimal

Convert 173 by dividing by 2 repeatedly and keeping the remainders: 173÷2 = 86 r1; 86÷2 = 43 r0; 43÷2 = 21 r1; 21÷2 = 10 r1; 10÷2 = 5 r0; 5÷2 = 2 r1; 2÷2 = 1 r0; 1÷2 = 0 r1. Reading the remainders from last to first gives 10101101. Verify with place values: the 1s sit in the 128, 32, 8, 4, and 1 places, and 128 + 32 + 8 + 4 + 1 = 173. ✓ For hexadecimal, skip the division entirely and split the binary into groups of four: 1010 and 1101. The first group is 8 + 2 = 10, which is the digit A; the second is 8 + 4 + 1 = 13, the digit D. So 173 = AD in hex, confirmed by A×16 + D = 160 + 13 = 173.

Worked Example 2: Hexadecimal 3F in Decimal, Binary, and Octal

3F is a typical byte value. To decimal, expand by place values: 3 sits in the 16s place and F, worth 15, sits in the 1s place, so 3×16 + 15×1 = 48 + 15 = 63. To binary, turn each hex digit into four bits: 3 = 0011 and F = 1111, giving 0011 1111; leading zeros carry no value, so this is written 111111. To octal, regroup those same bits into threes, from the right: 111 111, which is 7 and 7, so 77. Final check: octal 77 means 7×8 + 7 = 63. ✓ All three answers agree — and notice the economy of hex: two characters carry exactly what six binary digits say, which is why memory dumps and colour codes prefer it.

Why Programmers Love Hex

Memory addresses, color codes (#FF5733), and Unicode values are all written in hex because it is far shorter than binary but converts to it trivially. A single byte (0–255) is always exactly two hex digits. You will meet these conversions when decoding a CSS colour into red, green, and blue components, reading a MAC address or a crash log full of hex addresses, setting Unix file permissions in octal (755 means something precise), or revising for a computer science exam where the division and grouping methods above are done by hand.

Three Mistakes That Break Conversions

  1. Reading the remainders in the wrong order. After repeated division, the first remainder is the last binary digit. Writing them top-to-bottom reverses the number — 173 becomes a different value entirely.
  2. Using a digit the base does not own. There is no 2 in binary, no 8 or 9 in octal, and F is worth 15, not 16. One illegal digit invalidates the whole conversion.
  3. Grouping from the left. When splitting binary into fours (for hex) or threes (for octal), always group from the right and pad the leftmost group with zeros. Grouping from the left puts every digit in the wrong place value whenever the length is not an exact multiple.

Practice Tool

Type a value in any base above and watch all four representations update live, with the conversion steps shown. Also try the Roman numeral converter for a historical number system, or number to words for plain English.

Frequently Asked Questions

How do you convert binary to hexadecimal?

Group the binary digits into sets of four, working from the right and padding the leftmost group with zeros if needed, then replace each group with its hex digit (0–9, then A–F for the values 10–15). So 10101111 splits into 1010 and 1111, which are A and F, giving AF. The shortcut works because 16 = 2⁴, so each hex digit carries exactly four bits of information.

What is hexadecimal used for?

Hexadecimal is the working shorthand of computing. Web colours are written as three hex bytes, like #FF5733; memory addresses, MAC addresses, Unicode code points, and low-level error codes are printed in hex; and programmers use it to inspect raw data byte by byte. In every case the reason is the same: hex is four times shorter than binary, yet converts back to it digit by digit with no arithmetic.

How do you convert decimal to binary?

Divide by 2 over and over, writing down the remainder (0 or 1) at each step, until the quotient reaches 0. Then read the remainders in reverse — last one first. For 13: 13÷2 = 6 r1, 6÷2 = 3 r0, 3÷2 = 1 r1, 1÷2 = 0 r1, and reading upwards gives 1101. Check by place values: 8 + 4 + 0 + 1 = 13.

What do the letters A to F mean in hexadecimal?

They are single digits with the values 10 to 15: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. Hexadecimal needs sixteen distinct digit symbols because counting in base 16 rolls over after fifteen, and borrowing the first six letters keeps every digit to one character. So the hex number 1F means 1×16 + 15 = 31 — not one hundred and fifty-something.

Why does this converter reject some of my digits?

Because each base only owns a limited digit set: binary allows only 0 and 1, octal allows 0–7, decimal allows 0–9, and hexadecimal allows 0–9 plus A–F. Typing an 8 into an octal field or a G into a hex field does not form a number in that system, so the converter flags the invalid digit instead of silently producing a wrong result.

Is this base converter free?

Yes. Every calculator on Math Solver Free is completely free, with no sign-up, no account, and no usage limits. All calculations run locally in your browser, so your numbers are never uploaded or stored, and you can use the tool as many times as you like, on any device.

Related Tools & Guides

About the MathSolverFree Team

The MathSolverFree Team builds and maintains the calculators and step-by-step solvers on this site. Every tool is checked against worked textbook examples before it is published, and the method behind each solver is written out in full — in the worked examples on the page and in our guides — so you can see exactly how an answer is reached, not just the answer itself.

How we build and test our tools·More about the team