sccaf

Base Converter

Converting 0xFF to binary or 1011₂ to decimal is quick once you see the method. This base converter handles whole numbers of any length (using exact big-integer arithmetic), fractions, and negative numbers in two’s complement, and shows the repeated-division and place-value steps so you can check homework or understand what your code is doing.

Base converter

Working

Number Base Practice Pack

Printable number base reference and practice: hex/binary/octal table, powers of two chart, two’s complement card and conversion worksheets with answer keys.

Formats: PDF, XLSX, DOCX. Instant download after payment (link valid 72 hours, up to 5 downloads). AI-assisted: the templates were drafted with AI help and reviewed and laid out by Kedop.

$3.00 USD, one-time

Secure card checkout by Stripe. Full refund within 7 days — see the refund policy and license.

How number bases work

In base b, each position is worth b times the position to its right. In decimal (base 10), 347 means 3 × 100 + 4 × 10 + 7 × 1. In binary (base 2), 1011 means 1 × 8 + 0 × 4 + 1 × 2 + 1 × 1 = 11. Bases above 10 need extra digit symbols, so hexadecimal uses A–F for 10–15, and bases up to 36 use the whole alphabet.

Converting to decimal: place value

NumberExpansionDecimal
1011₂1·8 + 0·4 + 1·2 + 1·111
777₈7·64 + 7·8 + 7·1511
FF₁₆15·16 + 15·1255
1A3₁₆1·256 + 10·16 + 3·1419
0.101₂1·½ + 0·¼ + 1·⅛0.625

Converting from decimal: repeated division

  1. Divide the number by the target base.
  2. Write down the remainder — it is the next digit, from right to left.
  3. Repeat with the quotient until it reaches zero.
  4. Read the remainders from last to first.

For fractions, multiply the fractional part by the base instead: the whole-number part of each result is the next digit after the point. The tool shows both procedures.

Binary, octal and hex shortcuts

HexBinaryOctalDecimal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
A10101210
B10111311
C11001412
D11011513
E11101614
F11111715

Because 16 = 2⁴ and 8 = 2³, each hex digit maps to exactly four bits and each octal digit to three. To convert binary to hex, group bits in fours from the right: 1111 0101 = F5. This is why programmers use hex as a compact way to write binary.

Negative numbers: two’s complement

Computers usually store signed integers in two’s complement. To write −x in n bits, subtract x from 2ⁿ — or invert all the bits of x and add 1. In 8 bits, −1 is 1111 1111 (0xFF) and −128 is 1000 0000 (0x80). An n-bit signed value ranges from −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1, so 8 bits hold −128 to 127 and 32 bits hold −2,147,483,648 to 2,147,483,647. Choose the width in the converter to see the pattern your language or processor would store.

Worked example

Convert 255 to binary: 255 ÷ 2 = 127 r1, 127 ÷ 2 = 63 r1, and so on — eight remainders of 1, so 255 = 1111 1111₂, which groups neatly into FF in hex and 377 in octal. Now −42 in 16-bit two’s complement: 42 is 0000 0000 0010 1010; inverting gives 1111 1111 1101 0101 and adding 1 gives 1111 1111 1101 0110, or 0xFFD6. The converter shows the same.

Where you’ll meet different bases

Common values worth knowing

DecimalBinaryHexWhere you see it
1270111 11117FLargest signed 8-bit value; ASCII range
2551111 1111FFLargest byte; RGB colour channel maximum
2561 0000 0000100Number of values in a byte
1,02311 1111 11113FF10-bit maximum
65,5351111 1111 1111 1111FFFFLargest 16-bit unsigned value; highest port number
2,147,483,6470111 … 1111 (31 ones)7FFFFFFFLargest signed 32-bit integer
4,294,967,29532 onesFFFFFFFFLargest unsigned 32-bit integer

Notation in programming languages

BaseCommon prefixesExample
Binary0b0b1010
Octal0o, or a leading 0 in older C code0o755
Hexadecimal0x, #, or an h suffix in assembly0xFF, #FF8800
Decimalnone255

The converter accepts these prefixes when they match the selected base, and ignores spaces, commas and underscores used as digit separators.

Checking your answers

Precision

Whole numbers are converted exactly with arbitrary-precision integers, so 200-digit numbers are fine. Fractional parts use standard floating-point arithmetic and are rounded to the number of digits you choose; many fractions repeat forever in other bases.

Privacy

All conversions run in your browser.

Frequently asked questions

How do I convert binary to decimal?

Multiply each bit by its place value (1, 2, 4, 8…) and add them up.

How do I convert decimal to hexadecimal?

Divide by 16 repeatedly and read the remainders from last to first, using A–F for 10–15.

What is 255 in binary?

1111 1111.

What is two’s complement?

The standard way to store negative integers: invert the bits of the positive number and add 1.

What is the largest base supported?

Base 36, using digits 0–9 and letters A–Z.

Can it convert fractions?

Yes, the fractional part is converted to the number of digits you choose.

Why does 0.1 look strange in binary?

0.1 has no exact binary representation — it repeats forever — which is also why computers show tiny rounding errors.

What is octal used for?

Mainly Unix file permissions, such as chmod 755.