IEEE 754 Float32 Binary Converter – Free

This IEEE 754 binary converter turns a decimal number into its 32-bit single-precision encoding, in binary and hex, and converts a bit pattern back into the number it stands for.

How to use the IEEE 754 Float32 Converter tool

  1. To convert a number to binary, leave Input format on Number and type a decimal such as 6.5 in Number or bit pattern.
  2. To convert bits to a number, choose Hexadecimal or binary bits and enter up to 8 hex digits, or 0b followed by up to 32 binary digits.
  3. Select Inspect bits. The Example button converts -13.25.
  4. Read the Bits line for the 32-bit string and the Hex line for the compact form. Sign, Exponent and Fraction repeat the same bits field by field.
  5. Select Copy to copy the full result.

How to convert a decimal number to IEEE 754 binary

The converter follows the same steps you would use on paper. Here they are for 6.5.

  • Sign: 6.5 is positive, so the sign bit is 0.
  • Binary form: 6.5 is 110.1.
  • Normalize: 110.1 = 1.101 x 2^2.
  • Exponent: 2 + 127 = 129, written in 8 bits as 10000001.
  • Fraction: the digits after the leading 1, 101, padded with zeros to 23 bits.
  • Join the three fields: 0 10000001 10100000000000000000000, or 40D00000 in hex.
Value: 6.5
Hex: 0x40D00000
Bits: 01000000110100000000000000000000
Sign: 0
Exponent: 10000001
Fraction: 10100000000000000000000
Class: normal

Converting binary or hex back to a number

In bit mode, spaces are stripped, so you can paste a pattern with its fields separated: 0b0 01111111 00000000000000000000000 decodes to 1. Hex works with or without 0x, and C1540000 returns -13.25.

Patterns shorter than 32 bits are extended with zeros on the left, not the right. 0b111 becomes 00000007, a subnormal near 9.8e-45, not a number starting with three 1 bits. Type every trailing zero. Longer or malformed input returns Enter up to 8 hexadecimal digits or a binary number prefixed with 0b.

Numbers that change during conversion

Most decimal fractions have no exact binary32 form. The converter picks the nearest representable value and, on an exact tie, the one whose last fraction bit is 0. This is roundTiesToEven, the IEEE 754 default. No other rounding mode is offered.

The Value line shows what was stored. 0.3 becomes 0.30000001192092896. 16777219 becomes 16777220. 1e39 is beyond the largest float and becomes Infinity. 1e-45 rounds up to the smallest subnormal, 1.401298464324817e-45, and 7e-46 rounds down to 0.

Float32 next to the other float formats

Single precision carries 24 significant bits. Six decimal digits always survive a round trip through a float, and nine digits are enough to reproduce any float exactly. When that is too little, the IEEE 754 Float64 Converter shows the 64-bit encoding. For smaller machine learning formats there are separate FP16, BFloat16 and FP8 E4M3 converters, each with its own field widths.

Frequently asked questions

How is 1.0 written in IEEE 754 binary?

As 0 01111111 00000000000000000000000, or 3F800000 in hex. The exponent field 01111111 is 127, which cancels the bias and means 2^0. The fraction is zero because the leading 1 of the significand is implied, not stored.

What is 0.15625 in IEEE 754 single precision?

0.15625 is 0.00101 in binary, or 1.01 x 2^-3. The exponent field is 124 (01111100) and the fraction starts 01. The full pattern is 0 01111100 01000000000000000000000, which is 3E200000.

Can I enter a binary fraction such as 101.11?

Not as binary. Number mode reads its input as decimal, so 101.11 means one hundred one point one one. Convert the binary fraction to decimal first, here 5.75, or enter the already encoded 32-bit pattern in bit mode.

Which rounding mode does the converter use?

Round to nearest, ties to even. The input is parsed as a double and then narrowed to 32 bits, the same operation as a cast from double to float in C or Java, or Math.fround in JavaScript.

Why does the Value line not match the number I typed?

The number is not representable in 24 significant bits, so the nearest float was stored and the Value line prints that float with double-precision digits. For 0.1 it reads 0.10000000149011612. The difference is the rounding error.

Is this the same tool as the IEEE 754 Float Analyzer?

The calculation is the same, and both produce the same seven lines. Use whichever page you land on. The analyzer's guide focuses on value classes such as subnormal and NaN, while this one covers the conversion steps.

Related tools