CalcSeed

Base Converter

Convert an integer between bases 2, 8, 10 and 16. Enter a value, pick the base it is written in, and the base you want it in.

Converted value
—

What the converter returns

You give a numeral, the base it is written in, and the base you want, and the tool returns the same quantity in the target base. At the defaults the input is 255 read in base 10 and the output is FF in base 16. Only the digits change; the underlying value does not.

Base 2, 8, 10 and 16 are the four bases that matter in computing. All four are positional systems, so one arithmetic rule covers every pair: convert to decimal, then divide out into the target radix.

The four bases at a glance

DecimalBinaryOctalHex
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010

The table exposes the mechanic that makes these four bases useful. Sixteen is 24, so one hex digit stands for exactly four bits, and eight is 23, so one octal digit stands for three. Nothing is lost in the mapping, which is why hex and octal are treated as readable shorthand for binary rather than as separate number systems.

The formula behind the conversion

N=∑idibiN=sum_i d_i b^i

Here di is the digit at position i, counted from 0 at the rightmost digit, and b is the source base. A numeral is therefore a sum of digits times powers of the base. In 255 base 10 that is 2×100 + 5×10 + 5×1. In FF base 16 it is 15×16 + 15×1, which is also 255.

The calculator does the first stage with a running multiply-add, the same thing as the sum but evaluated left to right. Starting at 0, each digit updates the total as n = n × base + digit. For 255 in base 10: 0 → 2 → 25 → 255. For FF in base 16 the same loop gives 15 → 255. This is Horner’s method, and it is why no explicit power multiplication appears in the code.

The second stage is repeated division by the target base, keeping the remainders and reading them upward. Each remainder is a target digit, and division stops when the quotient reaches zero.

Worked example: 255 decimal to hex

Divide 255 by 16. The quotient is 15 and the remainder is 15. Since the quotient is not yet zero, divide again: 15 ÷ 16 = 0 remainder 15. Read the two remainders from last to first: 15, then 15, and 15 maps to the hex digit F. The result is FF.

  • 255 ÷ 16 = 15, remainder 15 → digit F in the low position
  • 15 ÷ 16 = 0, remainder 15 → digit F in the high position
  • Read upward: FF, which expands back to 15×16 + 15 = 255

The same quantity in all four bases

Binary: 255 is one less than 256, so it is eight ones, 11111111. Octal: 377, which is 3×64 + 7×8 + 7 = 192 + 56 + 7. Hex: FF. Decimal: 255. If you compare the binary and hex forms side by side, 1111 1111 splits into two nibbles worth 15 each, which is exactly why the hex answer is two Fs.

This is the sanity check to run on any conversion. Convert back by expanding the target digits with powers of the base; if the total matches the original decimal value, the result is right.

Choosing between hex and octal

  • Hex is standard for bytes, memory addresses, color codes and hash digests because two digits map to one byte exactly
  • Octal survives in Unix file permissions, where three digits encode read, write and execute for owner, group and others
  • Binary is used where the bit pattern itself matters, such as masks and flag fields
  • Decimal stays the default for anything a person reads as a number

Data entry rules

The value field takes digits only, so a numeral containing letters cannot be typed directly. When the source base is 16 the digits you do type are read as base-16 digits: entering 255 with From base 16 means 0x255, which is 2×256 + 5×16 + 5 = 597 decimal. If you need to convert a hex string that contains A to F, convert the decimal value with From base set to 10 instead.

Rounding, padding and legal digits

The field is rounded to a whole number, so 255.6 becomes 256, and leading zeros carry no weight: 007 is read as 7. Values are capped at 1015, roughly 50 bits, which is far beyond any address or identifier you would convert by hand.

One more limit: the digits are consumed literally, so a digit at or above the source base is not rejected. Entering 19 with From base 8 does not throw an error; it evaluates as 1×8 + 9 = 17. Check that every digit is legal for the base you selected before trusting the output.

Where conversions go wrong

The most frequent mistake is reading a hex answer as a decimal one. FF is 255, not fifteen fifteen and certainly not 255 in some other unit. A close second is dropping a leading zero: 0x0F is 15, and writing it as F changes the width of the field even though the value is unchanged, which matters when the bytes are packed into a fixed-size record.

Third is confusing base with width. A base-2 numeral of eight digits reaches 255, but a base-2 numeral of sixteen digits reaches 65,535; the base tells you the digit set, not the range. Sixteen bits is a range, eight bits is a range, and both can be written in any base.

Frequently asked questions

What is 255 in hexadecimal?

255 is FF. Divide 255 by 16 to get 15 remainder 15, then divide 15 by 16 to get 0 remainder 15, and read the remainders upward: F followed by F.

How do I convert binary to hex without going through decimal?

Group the bits into fours from the right and translate each group. 11111111 becomes 1111 1111, and 1111 is F, so the answer is FF. Each nibble is worth one hex digit.

Why does hexadecimal use letters?

Base 16 needs sixteen single-character digits, but only ten exist as numerals. A through F stand for 10 through 15, so each position stays one character wide.

What is 255 in octal?

377. 255 = 3×64 + 7×8 + 7, so the three octal digits are 3, 7 and 7. Each octal digit represents three bits, and 377 covers nine bits, enough for the eight-bit value.

How many bits does one hex digit represent?

Exactly four, because 16 = 24. Two hex digits cover one byte, which is why a byte is written as a pair such as 0x41.

What happens if I enter 255 with From base 16?

The digits are read as base-16 digits, so 255 means 2×256 + 5×16 + 5 = 597 decimal. Set From base to 10 to convert the decimal number 255 instead.

Is 0x prefix part of the number?

No. The 0x prefix is a programming-language marker meaning hexadecimal, borrowed from C. The number itself is just the digits, so FF and 0xFF are the same value of 255.

What is the largest value four hex digits can hold?

FFFF is 65,535, one less than 164. That is the full range of an unsigned 16-bit integer, and it is why 16-bit fields are often written with four hex digits.

Can I convert a negative number?

Not with this tool. The value field starts at 0, so negative values are outside its range. In code, signed integers are usually stored in two’s complement, which represents -1 as all ones, or FFFFFFFF in 32-bit hex.

Method and sources

Calculation basis

Conversions and formats follow the relevant IETF RFCs and IEEE standards, including RFC 4648 for Base64 and RFC 791 for IPv4 addressing.

Last updated: November 17, 2026
Formula & data sources
  • Positional numeral system place-value arithmetic.

Cite this page

Reference formats
APA 7CalcSeed. (2026, November 17). Base Converter. https://calcseed.com/c/developer/base-converter/
MLA 9"Base Converter." CalcSeed, 17 Nov. 2026, calcseed.com/c/developer/base-converter/.
ChicagoCalcSeed. "Base Converter." Last modified November 17, 2026. https://calcseed.com/c/developer/base-converter/

Related calculators