Developer & Data

Convert Large Integers Between Number Bases

Updated

A long integer can lose precision if it is converted through a floating point number. That is a problem when you are inspecting a hexadecimal identifier or a binary value whose exact digits matter.

Exact Number Base Converter works with integer digit strings for bases 2 through 36. It can handle values beyond the usual exact numeric range of a browser.

Confirm the base of the input

The decimal value 255 becomes FF in base 16 and 11111111 in base 2. Conversely, FF entered with source base 16 becomes 255 when the destination base is 10.

The same visible digits can represent different values in different bases. The input 10 means ten in decimal, sixteen in hexadecimal and two in binary. Set the source base before interpreting the result.

Digits must belong to the selected base. The tool does not silently accept 8 as a binary digit or treat an invalid character as zero.

Keep the task to whole numbers

Signed integer values are supported. Fractions, scientific notation and automatic language prefixes are not the purpose of this converter. Enter the digit string expected by the tool rather than assuming it will interpret a whole programming expression.

The input is limited to 128 digits. The conversion preserves the integer through digit operations rather than passing it through a browser floating point calculation.

Changing the base changes the representation, not the amount. A shorter hexadecimal result is not a smaller number. It is the same integer written with more possible symbols per digit.

If the result belongs in source code or a protocol field, check that field's separate width and formatting requirements. Padding, byte order and signed machine representation are concerns beyond converting the mathematical integer between bases.

Join the conversation

Your email address will not be published. Required fields are marked *

Explore Whatson tool information