Hex Dec Oct Bin Converter

Convert between hexadecimal, decimal, octal, and binary — the big four number bases — with four live fields. Type in any box and the other three update instantly, with every conversion's working shown step by step. It's the classic hex dec oct bin calculator: no from/to pickers, just four fields that stay in sync.

100% client-side — nothing you type ever leaves your browser Exact math, even for 100-digit numbers Free, no sign-up
Try:

The converter

Type in any field — hexadecimal, decimal, octal, or binary. The other three convert live, with steps shown below. Prefixes 0x, 0b, 0o and _ separators are accepted. Order doesn't matter: this is the same tool whether you search for a hex-dec-oct-bin converter or a bin-dec-hex-oct converter.

All 12 pairs at once: hex to decimal, decimal to hex, hex to binary, binary to hex, hex to octal, octal to hex, octal to decimal, decimal to octal, octal to binary, binary to octal, binary to decimal, decimal to binary.

Show your work

Every conversion is a two-step trip through decimal: expand the source digits into a decimal value, then divide that value down into each target base. The tables below update with your input.

Step 1 — source → decimal (place-value expansion)

Step 2 — decimal → the other bases (repeated division)

Worked examples

Example 1 — FF₁₆ → decimal, octal, binary

FF₁₆ = 255₁₀ = 377₈ = 11111111₂

  1. Expand to decimal: F = 15, so 15 × 16¹ + 15 × 16⁰ = 240 + 15 = 255.
  2. 255 → octal: 255 ÷ 8 = 31 r7, 31 ÷ 8 = 3 r7, 3 ÷ 8 = 0 r3 → read bottom-up: 377₈.
  3. 255 → binary: repeated division by 2 gives eight 1s: 11111111₂ — one full byte, all bits set.

Example 2 — 1010₂ → decimal, hexadecimal, octal

1010₂ = 10₁₀ = A₁₆ = 12₈

  1. Expand to decimal: 1 × 2³ + 0 × 2² + 1 × 2¹ + 0 × 2⁰ = 8 + 0 + 2 + 0 = 10.
  2. 10 → hexadecimal: 10 ÷ 16 = 0 r10; remainder 10 maps to A.
  3. 10 → octal: 10 ÷ 8 = 1 r2, 1 ÷ 8 = 0 r1 → 12₈.
  4. Shortcut: group the four bits as one nibble → A in hex directly, no decimal needed.

Example 3 — 777₈ → decimal, hexadecimal, binary

777₈ = 511₁₀ = 1FF₁₆ = 111111111₂

  1. Expand to decimal: 7 × 8² + 7 × 8¹ + 7 × 8⁰ = 448 + 56 + 7 = 511.
  2. 511 → hexadecimal: 511 ÷ 16 = 31 r15 (F), 31 ÷ 16 = 1 r15 (F), 1 ÷ 16 = 0 r1 → 1FF₁₆.
  3. 511 → binary: nine 1s: 111111111₂ — the largest value a 9-bit field holds (2⁹ − 1).

Methodology — how the conversions work

All four bases are positional number systems: each digit's worth depends on its position. The converter uses one exact integer algorithm and never touches floating-point numbers.

The two steps

Step 1 — source to decimal (expansion). Multiply each digit by its base raised to its position (counting from 0 on the right) and add everything up:

value = Σ digit × baseposition

For example, 2A₁₆ = 2 × 16¹ + 10 × 16⁰ = 32 + 10 = 42. Step 2 — decimal to target (repeated division). Divide by the new base, keep each remainder, and read the remainders from last to first. For example, 42₁₀ → hex: 42 ÷ 16 = 2 r10 (A), 2 ÷ 16 = 0 r2 → 2A.

The four bases at a glance

The four bases — hexadecimal decimal octal binary — are all positional systems that differ only in their radix (base):

BaseNameDigitsOne digit = how many bitsCommon uses
2Binary0–11Hardware, flags, machine language
8Octal0–73Unix file permissions (chmod), legacy systems
10Decimal0–9—Everyday counting
16Hexadecimal0–9, A–F4 (one nibble)Memory addresses, color codes, machine dumps

Why letters in hex? Base 16 needs sixteen distinct digit symbols, but we only have ten numerals, so A–F stand in for values 10–15.

Input syntax

  • Prefixes: 0xFF, 0b1010, 0o777 are accepted (case-insensitive). Decimal takes no prefix.
  • Separators: single underscores between digits (1_000_000, 0b1101_0011) for readability.
  • Sign: a leading minus converts the magnitude and shows the negative value in all four bases (for example −FF → −255 → −377 → −11111111). This is signed magnitude, not two's complement.
  • Invalid digits are rejected honestly: typing 2 in the binary field reports that "2" is not a binary digit and names its position, instead of guessing.

Precision — exact for any size

The engine computes with exact big integers, so there is no 53-bit limit like ordinary calculators have. A 64-bit maximum like 0xFFFFFFFFFFFFFFFF (18,446,744,073,709,551,615) and even 100-digit numbers convert with zero rounding error. Bit length is reported for every result.

Where octal and hex show up in real work

  • Unix file permissions are octal by convention: chmod 755 means the three permission groups encoded as octal digits.
  • IP addresses are four 8-bit groups (octets) — each octet is exactly one byte, 0–255, conveniently written in binary when studying subnet masks.
  • Memory addresses and color codes are hexadecimal because one hex digit maps exactly to 4 bits (a nibble), making long binary strings short and readable.

Honest scope

This tool converts whole numbers (integers) in the four standard bases, with four fields that all stay in sync. It does not convert fractions, arbitrary bases, or text encodings — and it says so instead of faking it. For fractions or any base from 2 to 36, use our arbitrary-base converter; the boundary note below maps each sibling tool to its job.

Which converter do you need? — tool boundaries

We publish several number-base tools. Each has a distinct job; pick the one that matches your intent:

  • This tool (hex-dec-oct-bin): the simultaneous "big four". Four live fields — hexadecimal, decimal, octal, binary — all update at once as you type, with per-conversion show-your-work steps. Built for the classic "FF = 255 = 377 = 11111111" question.
  • Arbitrary base converter (bases 2–36): when you need base 7, base 36, or any pair of bases — including fractions. This tool intentionally covers only the four standard bases.
  • Number base converter pro: the programmer's workbench — base-36 and custom bases plus bitwise operations (AND/OR/XOR/NOT/shifts), two's complement encode/decode, and character codes. This tool stays simple: no bitwise, no two's complement.
  • Fixed-pair converters (binary→decimal, binary→hex, …): single one-direction conversions for a specific pair. This tool is the all-directions-at-once alternative.
  • Legacy thin converters (dec-to-bin, hex-to-bin, …): older single-purpose pages; this tool supersedes them with live four-way conversion, error honesty, and worked steps.

Frequently asked questions

How do I convert hexadecimal to decimal?

Expand each hex digit by its place value: multiply the digit by 16 raised to its position (counting from 0 on the right) and add the results. For example, FF in hex = 15 × 16 + 15 × 1 = 240 + 15 = 255 in decimal. The converter above does this expansion and shows every step in the "Show your work" panel.

How do I convert decimal to binary, octal, or hex?

Use repeated division: divide the number by the target base, write down each remainder, and read the remainders from bottom to top. For example, 255 ÷ 2 = 127 remainder 1, 127 ÷ 2 = 63 remainder 1, and so on, giving 11111111 in binary. For hex, remainders 10–15 become the letters A–F. The steps panel shows every division row.

What happens if I type a digit that isn't valid, like 2 in binary?

The converter shows an honest error instead of guessing. It names the bad character and its position — for example, "2" is not a binary digit, binary uses digits 0–1 — and it points out exactly which input field has the problem. Fix the highlighted digit and all four fields update again.

Is there a shortcut between binary, octal, and hexadecimal?

Yes. Because 8 = 2³ and 16 = 2⁴, you can regroup digits instead of going through decimal. Group binary digits in threes (from the right) to read octal directly: 101 111 in binary = 57 in octal. Group in fours for hexadecimal: 1010 in binary = A in hex. And the reverse works too: each octal digit expands to exactly 3 bits, each hex digit to exactly 4 bits.

How do I read a binary number like 1010?

Read each position as a power of 2, doubling from the right: 8, 4, 2, 1. Add the values where the digit is 1. So 1010 in binary = 8 + 0 + 2 + 0 = 10 in decimal. Leading zeros don't change the value — 00001010 is still 10 — they're often added to fill a full byte (8 bits) or a nibble (4 bits).

What are hexadecimal, decimal, octal, and binary?

They are four positional number systems that differ only in their base: binary is base 2 (digits 0–1), octal is base 8 (digits 0–7), decimal is base 10 (digits 0–9), and hexadecimal is base 16 (digits 0–9 plus A–F for values 10–15). The base sets each digit's place value: in base b, positions from the right are worth b⁰, b¹, b², and so on.

What is a radix?

Radix is another word for base — the number of unique digits a numeral system uses. Binary is radix 2, octal is radix 8, decimal is radix 10, and hexadecimal is radix 16. It comes from the Latin word for "root".

Why do computers use binary, and why is hex used instead?

Computers use binary because a transistor or memory cell has two stable states (on/off), so base 2 is the natural hardware language. Hexadecimal is used as a shorthand for humans: one hex digit maps exactly to 4 bits (a nibble), so long binary strings become short and readable — for example 11111111 is just FF. That's why memory addresses, colors, and machine code dumps are written in hex.

How many bits are in a byte, a nibble, and a hex digit?

A byte is 8 bits, a nibble is 4 bits, and one hexadecimal digit represents exactly 4 bits (one nibble). So one byte needs exactly 2 hex digits: values 00–FF in hex cover the full byte range 0–255. An octal digit represents 3 bits, so a byte needs 3 octal digits (000–377).

What do the 0x, 0b, and 0o prefixes mean?

They are short labels that say which base follows: 0x means hexadecimal (for example 0xFF), 0b means binary (for example 0b1010), and 0o means octal (for example 0o777). The converter accepts them — paste 0xFF into the hex field or 0b1010 into the binary field and it converts normally. Plain decimal numbers have no prefix.

Can I convert negative numbers?

Yes. Put a minus sign in front (for example −FF or −1010) and all four fields show the negative value in each base. The minus applies to the whole number, and the show-your-work steps use the absolute value. The tool does not do two's complement encoding — it converts the magnitude with a sign.

How large a number can this converter handle?

Any size. The math runs on exact big integers, so even a 100-digit number converts with zero rounding error — try the "2⁶⁴−1" preset (18,446,744,073,709,551,615) to see all 64 binary digits. Values above about 15 digits would silently lose precision in ordinary calculators; this tool never does.

Can this converter handle fractions like 10.5?

No — this tool converts whole numbers (integers) only, and it says so honestly instead of faking it. For fractional conversions between any bases 2–36, use our arbitrary-base converter, which supports fraction digits with a clear truncation policy. Integers keep this tool's four live fields fast and exact.

Privacy: this page runs entirely in your browser. Your numbers are never sent to a server, stored, or logged — there is nothing to opt out of because nothing leaves the device.

Free tool by NRTechStudio