Automate your affiliate marketing. Read our expert review of Dolphin Anty. Read Review

Decimal Converter

0 of 0 ratings

Type a value in any field and the others follow. Everything is converted in your browser: nothing is uploaded.

With a width the numbers are written with all their bits, and a negative number as two's complement.

Decimal Converter: Decimal, Binary, Hex and Octal

Type a decimal number and the binary, octal and hexadecimal fields show it at once, or start from any of them to get the decimal number. The "Text and codes" tab writes the decimal code of every byte of a text, and the "Float and hex" tab shows how a decimal fraction is stored in 32 or 64 bits. Everything happens in your browser: nothing you type is uploaded.

How to convert decimal to binary, hex and octal

Divide the number by the base again and again and read the remainders from the last to the first. For 45: 45 / 2 gives the remainders 1, 0, 1, 1, 0, 1, so 45 is 101101 in binary. In hex, 45 / 16 = 2 remainder 13 (D), so 45 is 2D. In octal, 45 / 8 = 5 remainder 5, so 45 is 55. The converter does it for numbers of any size without losing a digit.

Octal: where it is still used

Octal is the number system with the digits 0 to 7, base 8. One octal digit is three bits. It survives in the permissions of files on Linux and macOS: chmod 755 is 111 101 101 in binary, which means read, write and run for the owner, and read and run for the group and everyone else.

Negative numbers and the bit width

Choose 8, 16, 32 or 64 bits to see how a program stores the number: with all the bits written, and a negative number as two's complement. -1 is FF in 8 bits and FFFFFFFF in 32 bits. A number that does not fit the chosen width is reported with the range that fits, for example -128 to 127 for 8 signed bits.

Decimal codes of text

On the "Text and codes" tab choose Decimal: "Hello" becomes 72 101 108 108 111. For letters of the English alphabet these are the ASCII codes; other letters are written as the two to four bytes of their UTF-8 encoding.

Limitations

  • Whole numbers on the numbers tab, up to 5000 digits. For a fraction such as 0.1 use the "Float and hex" tab.
  • Thousands separators are not read: write 1000, not 1,000 (spaces and underscores are fine).

Similar tools

Binary Converter

Binary converter online: binary to decimal, hex and text and back, any size, with bit widths and two's complement. Also float to binary. Works in your browser.

13
Hex Converter

Hex converter online: hexadecimal to decimal, binary and text and back, any size, plus float to hex (IEEE 754, 32 and 64 bit). Works in your browser.

13
ASCII Converter

ASCII converter online: text to ASCII codes in decimal, hex, binary or octal and back, with the full ASCII table. Works in your browser.

20
Number to Words Converter: Write Numbers in Words (English, Ukrainian, Russian, Portuguese)

Number to words converter online: write any number or amount of money in words in English, Ukrainian, Russian or Portuguese, with ordinals, and turn words back to digits.

14

Popular tools