Перейти к основному содержимому
Develop Tools
← Вернуться к руководству по использованию

How to convert between binary, decimal, and hexadecimal numbers

When dealing with bit strings, color values, addresses, and authority values, specifying the radix and bit width to avoid misreading can be avoided.

Convert
Convert

When this guide is useful

Users who want to convert between binary, decimal, and hexadecimal numbers, and calculate from hexadecimal to decimal, two's complement, and negative numbers can learn how to choose the correct base and bit width.

  • Check program flag values in binary
  • Convert hexadecimal numbers of RGB colors and addresses to decimal numbers
  • Interpret register value as signed two's complement

Convert

  • Input
  • Prefixes such as 0b, 0o, 0x, etc.
  • Additional information for this feature.
  • Bit width such as 8, 16, 32, 64bit

Steps for converting decimal numbers

  1. Input
  2. Select the radix and display format you want to output.
  3. Additional information: 2
  4. Copy

Additional information: 2

Additional information: 16 8bit FF 255 2 -1

The bitwise representation of decimals and floating-point numbers has different rules than the base conversion of integers. Please check the type of target data first.

Specific example: Comparing 8bit FF with signed/unsigned

FF represents 255 in hexadecimal, but in an 8-bit signed 2's complement number, the most significant bit is the sign, which is -1.

Additional information for this feature.

  1. Input
  2. Enter FF.
  3. Check the 8bit unsigned result.
  4. Result

Additional information: 16 8bit

Frequently asked questions

Can I convert it even if I add 0x or 0b?
Settings
Additional information for this feature.
Integers are converted using BigInt, but be careful of the practical number of digits and the browser's processing limit.

попробуйте в браузере

Ваш ввод будет обработан в вашем браузере. Пожалуйста, оставьте исходные данные и проверьте результаты перед сохранением и публикацией.

Open the decimal conversion tool