Numeral System Converter

This numeral system converter converts any non-negative integer between the four positional number systems used in mathematics and computing: decimal (base 10), binary (base 2), octal (base 8), and hexadecimal (base 16). Every number system uses a different set of symbols and a different positional weight, but they all represent the same underlying quantity. Decimal uses digits 0 through 9 and is the system you use every day. Binary uses only 0 and 1, mapping directly to the on/off states of transistors in digital hardware. Octal uses 0 through 7 and is used in Unix file permission codes and some assembly languages. Hexadecimal uses 0 through 9 and then A through F for values 10 to 15, giving a compact notation for large binary numbers because each hex digit represents exactly four binary bits. The converter uses JavaScript's built-in parseInt to parse your input in the selected base, then calls toString with each target base to produce the output. You choose a base from the dropdown, enter an integer in that base using the correct digits for that system (binary accepts only 0 and 1; hex accepts 0-9 and A-F), and all three other representations appear immediately. The result for hex is displayed in uppercase. This tool suits programming students, network engineers working with IP and MAC addresses, system administrators writing chmod permissions, developers debugging bit flags, and anyone who needs to cross-check a value across number bases. The converter handles integers only; it does not support fractional values in any base.

Calculate.co.nz is proud to be partnered with Premium Homes, a recognised leader in eco-friendly, sustainable, and energy-efficient homebuilding. With a dedicated team and award-winning experience, they create homes that prioritise health, comfort, and long-term performance. Their founders, Andrew and Kelly, set out to raise the standard of residential construction in New Zealand by combining practical building expertise with a clear commitment to doing things better for homeowners.
Premium Homes: got a section? Let's build your eco home on it.
Advertise on this page
FF
hexadecimal (base 16)
Decimal255
Binary11111111
Octal377

How it works

The converter calls parseInt(value, base) to parse your input string as a number in the chosen base, producing a standard JavaScript integer. It then calls that integer's .toString(base) method with each target base (2, 8, 10, 16) to produce the output strings. Hexadecimal output is converted to uppercase. If the input contains characters that are not valid for the selected base, they are ignored and the remainder is parsed. Very large integers may lose precision above 2^53 because JavaScript uses 64-bit floating-point internally.

Worked example

Starting from 255 in decimal: parseInt('255', 10) = 255. Calling (255).toString(16) gives 'ff', shown as FF. Calling (255).toString(2) gives '11111111'. Calling (255).toString(8) gives '377'. These match the default values pre-filled in the converter above.

Related calculators