Base-N Number Converter
Convert base nconverter between units instantly. Includes conversion tables, common equivalents, and calculation formulas.
Base-N Number Converter
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: Decimal = sum of (digit x base^position); Target = repeated division by target base
Worked example โ 255 (base 10) = FF (base 16)
Formula
Decimal = sum of (digit x base^position); Target = repeated division by target base
Convert to decimal by multiplying each digit by the source base raised to the power of its position (rightmost is 0) and summing. Then convert from decimal to the target base by repeatedly dividing by the target base and collecting remainders in reverse order.
Worked Examples
Example 1: Decimal to Hexadecimal
Problem:Convert decimal 255 to hexadecimal (base 16).
Solution:255 / 16 = 15 remainder 15 (F) 15 / 16 = 0 remainder 15 (F) Reading remainders bottom to top: FF
Result:255 (base 10) = FF (base 16)
Example 2: Binary to Octal
Problem:Convert binary 11010110 to octal (base 8).
Solution:First convert binary to decimal: 1x128 + 1x64 + 0x32 + 1x16 + 0x8 + 1x4 + 1x2 + 0x1 = 214 Then 214 to octal: 214 / 8 = 26 r 6, 26 / 8 = 3 r 2, 3 / 8 = 0 r 3 Result: 326
Result:11010110 (base 2) = 326 (base 8)
Frequently Asked Questions
What is a number base or radix?
A number base (also called radix) is the number of unique digits used to represent numbers in a positional numeral system. Base 10 (decimal) uses digits 0-9, base 2 (binary) uses 0-1, base 16 (hexadecimal) uses 0-9 and A-F. Each position in a number represents a power of the base. For example, 42 in base 10 means 4 times 10 to the first power plus 2 times 10 to the zero power, equaling forty-two.
How do I convert between any two bases?
The standard approach is a two-step process. First, convert the source number to base 10 (decimal) by multiplying each digit by its positional power of the source base and summing the results. Second, convert the decimal value to the target base by repeatedly dividing by the target base and collecting remainders. This converter handles both steps automatically for any base from 2 to 36.
Why is base 16 (hexadecimal) commonly used in computing?
Hexadecimal is popular in computing because it provides a compact representation of binary data. Each hex digit corresponds to exactly 4 binary bits, so one byte (8 bits) is represented by exactly two hex digits. This makes it easy to read and write memory addresses, color codes (like FF0000 for red), and byte values. Compared to binary, hex reduces the length of a representation by a factor of four while maintaining a simple digit-to-bits mapping.
What bases are supported by this converter?
This converter supports any base from 2 to 36. Bases 2 through 10 use numeric digits 0-9 as needed. Bases 11 through 36 extend the digit set with letters A through Z, where A represents 10, B represents 11, and so on up to Z representing 35. Common bases include binary (2), octal (8), decimal (10), duodecimal (12), hexadecimal (16), and base 36 which is the maximum single-character digit base.
Why is base 36 the highest radix this converter supports?
The digit alphabet runs 0 through 9 and then A through Z, which is exactly 36 distinct single-character symbols. Base 36 uses every one of them, with Z representing 35, so there is no unused glyph left for a base 37 digit. Higher-radix encodings such as base 64 exist, but they extend the alphabet with lowercase letters and punctuation, which makes them case-sensitive and no longer a simple extension of the familiar hexadecimal digit set.
How many digits will a number need in a given base?
For a positive integer n, the digit count in base b is floor(log base b of n) plus one. The value 255 needs eight binary digits because log2 of 255 is about 7.994, and only two hexadecimal digits because log16 of 255 is about 1.998, giving FF. This is why larger bases produce shorter strings: each extra digit multiplies the representable range by the base, so raising the radix shrinks the number of positions needed roughly in proportion to log b.
Why do bases that are powers of two convert to binary without going through decimal?
When the radix is 2 raised to the power k, every digit corresponds to a fixed block of exactly k bits, so conversion is pure regrouping rather than arithmetic. Octal is base 2 cubed, so one octal digit is three bits; hexadecimal is 2 to the fourth, so one hex digit is four bits; base 32 maps to five bits. Bases such as 10, 7, or 36 are not powers of two, so they need the full divide-and-collect-remainders algorithm with decimal as an intermediate step.
How are negative numbers represented compared with two's complement in hardware?
This converter accepts digit characters only, so a leading minus sign is rejected and no result is shown; enter the magnitude and note the sign yourself. Processors instead store signed integers in two's complement, where a negative value minus n inside an N-bit word is encoded as 2 to the power N minus n. In an eight-bit register, minus five becomes 256 minus 5, which is 251, or 11111011 in binary. That is why a raw memory dump of a negative number never shows a minus sign.
How do I convert the fractional part of a number to another base?
The repeated-division method only handles the integer portion, and this tool accepts digits only, so an input containing a radix point returns no result at all. For a fraction, use repeated multiplication instead: multiply the fractional part by the target base, write down the integer part of the product as the next digit, keep the remaining fraction, and repeat. Note that a fraction terminating in one base can repeat forever in another, which is why decimal 0.1 becomes an endlessly repeating binary fraction and cannot be stored exactly in a binary float.
What is the difference between reading binary as octal versus hexadecimal?
Octal packs three bits per digit and hexadecimal packs four. Since a byte is eight bits, hexadecimal splits it cleanly into two digits covering 00 to FF, while octal leaves an awkward remainder, so a byte spans a two-bit group plus two triads and runs 0 to 377. That mismatch is why hexadecimal took over once eight-bit bytes became universal. Octal survives where three-bit groupings are natural, most visibly in Unix file permission modes such as 755.
References
Reviewed for accuracy by Manoj Kumar, Mathematics Educator ยท Editorial policy
Related Calculators
๐งฎMach Number Converter
Convert Mach number to speed in MPH, KPH, and m/s at different altitudes.
๐งฎNewtons to Pounds-Force Converter (N, lbf, kgf)
Convert between Newtons, pounds-force, kilogram-force, and dynes.
๐งฎTorque Unit Converter
Calculate torque unit converter with inputs, formulas, and instant results.
๐งฎElectrical Resistance Converter (ฮฉ, kฮฉ, Mฮฉ)
Calculate electrical resistance unit converter with inputs, formulas, and instant results.
๐งฎTime Unit Converter
Calculate time unit converter with inputs, formulas, and instant results.
๐งฎArea Converter
Calculate area converter with inputs, formulas, and instant results.
๐งฎAresto Hectares Converter
Calculate aresto hectares converter with inputs, formulas, and instant results.
๐งฎCentimeter to Inch Converter
Calculate centimeter to inch converter with inputs, formulas, and instant results.