How to Convert Between Binary, Decimal, and Hex

Convert binary, octal, decimal, and hex with place value, nibble groups, and common CS uses — free multi-base converter with bit views.

By Generatr Team

Binary, decimal, and hexadecimal are the same quantities written with different place-value radices: base 2, base 10, and base 16. Octal (base 8) sits alongside them in older Unix permissions and some textbooks. You convert so humans can read magnitudes while machines keep bit patterns clear.

This guide covers bases 2, 8, 10, and 16, why hex maps cleanly onto 4-bit groups (nibbles), and where these forms show up in computer science. Practice with the free binary decimal hex converter — synchronized bases, bit visualization, and step-style breakdowns in the browser.

For any radix from 2–36, use the number base converter and its number base guide. For arithmetic on bit strings, switch to the binary calculator.

Free tool

Use the Binary/Decimal/Hex Converter now

Open the interactive binary/decimal/hex converter in your browser — free, instant, no signup.

Open Binary/Decimal/Hex Converter

What Are Bases 2, 8, 10, and 16?

A base (radix) is how many digit symbols you use before carrying to the next place. Each place is a power of that base.

  • Binary (base 2) — digits 0–1. Places are powers of 2: … 16, 8, 4, 2, 1. 1011 = 8 + 0 + 2 + 1 = 11 decimal.
  • Octal (base 8) — digits 0–7. Places are powers of 8. One octal digit packs 3 bits (2³ = 8).
  • Decimal (base 10) — digits 0–9. Everyday counting; places are powers of 10.
  • Hexadecimal (base 16) — digits 0–9 and A–F (values 10–15). One hex digit packs 4 bits (2⁴ = 16).

Why four bases, not one?

Decimal is for people. Binary is what hardware stores. Hex is a compact map of binary for dumps and constants. Octal still appears in file modes like 0755 and some assembly examples.

Enter any one form in the free binary decimal hex converter and read the other three at once so the mappings stick. After a few round trips (decimal → hex → binary → decimal), you stop treating each base as a separate language.

Students often memorize “hex for colors” and “binary for computers” without connecting both to the same integer. Keep one concrete value — for example 42 — and write it as 101010, 52 octal, and 2A hex. That single anchor beats a wall of conversion tables you never reuse.

How Do You Convert Binary to Decimal?

Expand each bit by its power of two and sum the contributions of every 1 bit.

Example: 110101

  • 1×2⁵ = 32
  • 1×2⁴ = 16
  • 0×2³ = 0
  • 1×2² = 4
  • 0×2¹ = 0
  • 1×2⁰ = 1

Total: 32 + 16 + 4 + 1 = 53.

Decimal to binary

Repeatedly divide by 2 and collect remainders from last to first. 53 ÷ 2 → rem 1, 26 → 0, 13 → 1, 6 → 0, 3 → 1, 1 → 1 → 110101.

For fixed widths (8-bit, 16-bit), pad leading zeros on the left so the bit string matches the word size you care about. Unsigned 8-bit holds 0–255; the same 8 bits as signed two’s complement hold −128 through 127.

Verify both directions in the converter, then try addition of the binary forms in the binary arithmetic guide when you leave pure conversion for ops.

Why Does Hex Map Cleanly Onto Bit Groups?

Because 16 = 2⁴, each hex digit is exactly four bits — a nibble. Group binary from the right in fours, convert each group, and you have hex without long division.

Binary → hex: 1101 0101 → D (13) and 5 → 0xD5.

Hex → binary: each digit expands to a fixed 4-bit table (0 → 0000, …, F → 1111). 0xA3 → 1010 0011.

Octal grouping

Octal uses 3-bit groups: 111 010 001 → 7 2 1 → 0721 octal. Less common in modern UI dumps, still useful for permissions and older docs.

Notation habits

  • Prefixes: 0b binary, 0x hex, sometimes 0o octal in code
  • Case: 0xFF and 0xff are the same value; styles differ by language/linter
  • Leading zeros: padding shows width, not a different magnitude

Use the converter’s nibble/bit view to see groups live. When the payload is text bytes rather than a single integer, the binary to text guide and binary to text converter cover encoding strings as bit/byte streams.

Where Do Binary and Hex Show Up in Computer Science?

You will meet these bases constantly once you leave pure app-level decimal math.

  • Memory and registers — debuggers show hex addresses and hex register dumps
  • Bit masks and flags — permissions, feature bits, and protocol fields are easier as hex constants (0x0F for low nibble)
  • Color channels#RRGGBB is hex per channel (related notation; different domain)
  • Network and files — packet captures and hex editors display raw bytes
  • Character codes — ASCII/Unicode code points often listed in hex; see the ASCII value guide
  • Machine arithmetic — overflow and two’s complement live in fixed bit widths

Converting a small integer by hand trains the same place-value muscle you need to read a hex dump without panic. Homework problems that say “give the 8-bit two’s complement of −5” are conversion plus signed representation — not a different universe of math.

For character-level mapping (letter → code point), open the ASCII value converter. For full arbitrary bases beyond 2/8/10/16, use the number base converter.

How Do Signed Values and Bit Width Affect Conversion?

The same bit pattern can mean different integers depending on interpretation and width.

  • Unsigned 8-bit — 0 to 255. Pattern 11111111 = 255.
  • Signed two’s complement 8-bit — −128 to 127. Pattern 11111111 = −1.
  • 16/32/64-bit — same idea, larger ranges; converters often cap near 64-bit for practical UI.

Worked caution

If you convert “−1” to binary without stating width, there is no single infinite string of ones that tools agree on as “the” answer. Always fix width for signed homework and firmware work. Positive values still need padding when the assignment says “16-bit representation.”

Hex of a full machine word is simply the bit pattern grouped by fours. Reading 0xFFFFFFFF as unsigned 32-bit is 4,294,967,295; as signed 32-bit it is −1. The digits did not change — the interpretation did.

Cross-check magnitudes in decimal in the binary decimal hex converter, then stress arithmetic overflow with the binary calculator when width is part of the lesson.

When debugging, write the width next to the value: “0xFF (uint8)” or “0xFFFF_FFFF (int32)” so teammates do not re-interpret your hex dump under a different type. Clear labels prevent half the “wrong converter” arguments in code review.

What Is a Reliable Multi-Base Conversion Workflow?

Use a consistent path so you do not invent hybrid bases mid-problem.

  1. Identify the source base and legal digits (binary only 0–1; hex 0–9A–F).
  2. Prefer binary as the intermediate when going hex ↔ octal (group bits by 4 or 3).
  3. For decimal ↔ binary, use place expansion or repeated divide/multiply.
  4. State width and signedness when the problem cares about representation, not only magnitude.
  5. Sanity-check: convert back to the original form and confirm identity.
  6. For large values, trust a tool for the arithmetic but still verify digit legality by eye.

Common mistakes: treating hex letter B as decimal eleven without converting, padding on the wrong side, and mixing octal digits 8 or 9 into base 8. Illegal digits should hard-fail — if a tool “helps” by stripping them silently, double-check.

Drill with the free converter, then re-solve one textbook row on paper. Pair pure conversion with the bases 2–36 guide when a course jumps past hex into arbitrary radix.

How Do You Use Generatr’s Binary/Decimal/Hex Converter?

One value, four readouts, optional bit detail.

  1. Open the free binary decimal hex converter.
  2. Type a number in binary, octal, decimal, or hex.
  3. Watch the other bases update in sync.
  4. Inspect bit/nibble grouping when the tool shows visualization.
  5. Read any step-style expansion to match classroom method.
  6. Adjust for signed/unsigned or width options when available.
  7. Copy the form your notes or code need (often hex with 0x).
  8. Confirm one small example by hand (e.g. 0x2A = 42 = 101010).

Related tools: number base converter for radices outside 2/8/10/16, binary calculator for ops, binary to text converter for string bitstreams, and ASCII value converter for character codes.

Step-by-Step Instructions

  1. 1Open the free binary decimal hex converter on Generatr.
  2. 2Choose or focus the input field for the base you already have (binary, octal, decimal, or hex).
  3. 3Enter only legal digits for that base (0–1, 0–7, 0–9, or 0–9A–F).
  4. 4Read the synchronized values in the other three bases.
  5. 5Use bit or nibble grouping to verify hex and octal against binary.
  6. 6Note width and signed interpretation when your assignment requires a fixed bit count.
  7. 7Copy the format you need for code, homework, or a hex dump note.
  8. 8Convert back to the original base once to confirm the round trip.

Frequently Asked Questions

How do you convert binary to hexadecimal quickly?+

Group bits in sets of four from the right, then map each group to one hex digit (0000=0 … 1111=F). Example: 11110000 → F0. Pad the left with zeros if the bit length is not a multiple of four.

What is the difference between hex and decimal?+

Decimal uses base 10 (digits 0–9). Hexadecimal uses base 16 (0–9 and A–F). The value 255 decimal is FF hex. Hex is preferred in programming because each digit is exactly four bits.

Why is octal still taught?+

Octal groups bits by threes and appears in Unix file permission modes and older documentation. Modern dumps favor hex, but octal conversion is the same place-value skill with base 8.

Can the same binary mean different numbers?+

Yes. Interpretation depends on signedness and width. Eight 1-bits are 255 unsigned or −1 in 8-bit two’s complement. Always state the representation when answers diverge.

Is Generatr’s binary decimal hex converter free?+

Yes. Convert among binary, octal, decimal, and hex in your browser without an account. Use it to check homework and to build fluency reading bit-oriented formats.

Ready to try it yourself?

Use the free Binary/Decimal/Hex Converter — no download, no account.

Launch Binary/Decimal/Hex Converter