Binary / Hex / Decimal Converter

Convert between binary, decimal, hexadecimal and octal number systems instantly.

Source: BBC Bitesize — Binary and data representation

Konstantin Iakovlev

By Konstantin Iakovlev · Founder, Calks.uk

Last updated: · Verified against HMRC and GOV.UK 2026/27 rates

Decimal

255

Binary

11111111

Hexadecimal

FF

Octal

377

Disclaimer

This calculator is provided for informational purposes only and should not be considered as financial or tax advice. All calculations are performed locally in your browser — no personal data is collected or sent to our servers. Rates and thresholds are sourced from HMRC and GOV.UK and are updated for the current tax year. Always verify results with HMRC or consult a qualified professional before making financial decisions.

How It Works

Binary (base-2) uses only 0 and 1 to represent numbers. Each position represents a power of 2, starting from the right: 1, 2, 4, 8, 16 and so on. This converter translates between binary, decimal (base-10), octal (base-8) and hexadecimal (base-16).

Binary is the foundation of all digital computing — every piece of data in a computer is ultimately stored as a sequence of binary digits (bits). Hexadecimal is commonly used in programming as a shorthand for binary, where each hex digit represents exactly four bits.

Why binary matters. All digital computing is binary at the lowest level: 0 and 1 represent OFF/ON, false/true, low/high voltage. CPUs have billions of transistors switching between these two states. Storage units are powers of 2: byte=8 bits (256 values, 2⁸); short=16 bits (65,536); int=32 bits (4.3 billion); long=64 bits (18 quintillion). UK A-Level Computer Science covers binary, hexadecimal, octal, two's complement representation.

Decimal to binary conversion. Method 1 (division by 2): divide by 2, write remainders, read bottom-up. Sample: 42 ÷ 2 = 21 r0; 21 ÷ 2 = 10 r1; 10 ÷ 2 = 5 r0; 5 ÷ 2 = 2 r1; 2 ÷ 2 = 1 r0; 1 ÷ 2 = 0 r1. Read upwards: 101010. Method 2 (subtraction): subtract largest power of 2 fitting, mark 1; repeat. 42 = 32+8+2 = 101010. Verify: 32+8+2 = 42 ✓.

Binary to decimal — positional notation. Each binary digit (bit) represents a power of 2. Reading right to left: 2⁰ = 1, 2¹ = 2, 2² = 4, 2³ = 8, 2⁴ = 16, 2⁵ = 32, 2⁶ = 64, 2⁷ = 128. Sample 10110: (1×16) + (0×8) + (1×4) + (1×2) + (0×1) = 16+4+2 = 22. Memorise powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096.

Binary arithmetic — addition and subtraction. Addition rules: 0+0=0; 0+1=1; 1+0=1; 1+1=10 (carry 1). Sample: 1011 + 0110 = 10001 (add bit by bit with carry). Subtraction: same as decimal but borrow 2 instead of 10. Negative numbers: 'two's complement' — flip all bits, add 1. Sample 8-bit −5: 5 = 00000101; flip = 11111010; +1 = 11111011. Two's complement allows addition/subtraction with same circuit.

Hexadecimal — the human-friendly binary. Base-16 representation. Digits 0-9 + A-F (A=10, B=11, C=12, D=13, E=14, F=15). Each hex digit = 4 binary digits (nibble). Sample: binary 11010110 → 1101=D, 0110=6 → 0xD6. Decimal 214 → D6 hex. UK A-Level CS uses extensively. Hex used in: HTML colors (#FFFFFF = white = 16,777,215 = decimal); MAC addresses; memory addresses (0x7FFE...); file dumps. Easier to read than long binary strings.

Example: Converting decimal 255

  1. Decimal 255 = Binary 11111111
  2. Decimal 255 = Octal 377
  3. Decimal 255 = Hexadecimal FF
  4. 11111111 in binary = 128+64+32+16+8+4+2+1 = 255

Source: BBC Bitesize — Binary and data representation

Frequently Asked Questions

What does the Binary / Hex / Decimal Converter do?
Convert between binary, decimal, hexadecimal and octal number systems instantly.
How accurate are the results?
This calculator uses standard mathematical algorithms and provides results accurate to the precision shown. For very large numbers or high-precision requirements, results are rounded to a reasonable number of decimal places.
Can I use this for schoolwork?
Yes. This calculator is suitable for GCSE, A-level and university-level mathematics. It follows standard mathematical conventions used in UK education.