Convert Binary and Hexadecimal Values Safely
The digits 10 mean ten in decimal but two in binary.
Identify the source base
The digits 10 mean ten in decimal but two in binary. Always select the base before interpreting a value. Hexadecimal adds A through F for values ten through fifteen; a digit must be smaller than its base.
Check place values
Hexadecimal 2A is 2 × 16 + 10, which is 42 in decimal. Binary 101010 represents 32 + 8 + 2, giving the same value. These small examples are useful checks of the chosen conversion direction.
Leave prefixes out of the value field
Enter FF with source base 16, rather than 0xFF. Leading zeros do not change a whole number’s value, and the output is not padded to a fixed width. Add display padding separately if a file format requires it.
State the negative-number convention
A signed mathematical value and a fixed-width bit pattern are different descriptions. The converter uses a leading minus sign. It does not infer a word size, signed machine type, overflow wraparound or a two’s-complement interpretation.
Put it into practice
Roman Numeral Converter
Convert whole numbers from 1 to 3999 to Roman numerals, or validate and convert standard Roman numerals back to numbers.
Numbers & textScientific Notation Converter
Convert ordinary numbers and E notation into a normalized scientific-notation display.
Numbers & textNumber Base Converter
Convert signed whole numbers between binary, octal, decimal, hexadecimal and bases 2–36.
Developer tools