Illustration showing example numbers in decimal, hexadecimal, octal, and binary.

Number Base Conversions

Decimal, Hex, Octal & Binary

Edit any base field; decimal, hexadecimal, octal, and binary stay in sync. One's and two's complement binary are shown at the same width.

Representations

Non-negative whole numbers. Optional 0x, 0o, and 0b prefixes are accepted in hex, octal, and binary fields. Complements use the same bit width as the binary field.

Hexadecimal, octal, and binary values are grouped in blocks of four digits for readability. Spaces are ignored when parsing. One's complement inverts every bit; two's complement is one's complement plus one, both in the same width as the binary value above.

How number base conversion works

Binary, octal, decimal, hexadecimal

Positional number systems use digit places that multiply by the base. Binary (base 2) and hexadecimal (base 16) dominate computing; octal (base 8) still appears in Unix permissions and some legacy dumps; decimal (base 10) is everyday counting. Edit any field here and the others update to the same integer value.

Worked example

Decimal 255 is binary 11111111, octal 377, hex FF. Decimal 16 is binary 10000 and hex 10 — a reminder that “10” means the base itself in every system.

Common mistakes

  • Writing hex with digits beyond F, or binary with digits other than 0/1.
  • Confusing hex colour #FF00FF notation with integer 0xFF00FF endian topics.
  • Ignoring leading zeros that only pad display width.

FAQs

Signed values?
See Signed & Unsigned for two’s complement widths.
Beginner guide?
Number bases for beginners.

When this page helps

Use it when you want a transparent, browser-side calculation with the assumptions spelled out — then verify anything high-stakes against primary docs, a professional, or your own measurements. The related links below point to sibling tools and longer guides when you need more context.

Accuracy notes

Results depend entirely on the numbers you enter and the simplified model described above. Device clocks, tape measurements, market rates, and recipe conventions can all differ from a perfect textbook case. If an output looks surprising, re-check units first, then re-read the formula section.

Related: Bitwise Operations, Unix Permissions.

Last updated: July 2026