IEEE 754 Float Converter

See exactly how a number is stored as a float. Convert decimals to IEEE 754 half, single or double precision bits and back, with the exact stored value, the rounding error and the bit fields.

Converter Number Systems Updated Oct 3, 2026
How to Use
  1. Choose decimal to bits to see how a number is stored, or bits to decimal to read a hex pattern.
  2. Pick half (16-bit), single (32-bit, float) or double (64-bit, double) precision.
  3. Type a number (0.1, 1/3, 6.02e23, inf, nan or −0) or a hex pattern such as 0x3FB999999999999A.
  4. Read the hex, the stored value, the rounding error and the kind of number; the drawing marks the sign, exponent and mantissa.
  5. The table gives the exact stored value, the neighbouring floats and the gap between them.
Input
0.1, 1/3, 6.02e23, inf, nanhex, e.g. 0x3FB999999999999A
Presets
Sign, exponent, mantissa
Hex
—
Stored value
—
Rounding error
—
Kind
—

Worked Example

0.1 as a double. In binary 0.1 is 0.000110011001100…, repeating. Normalised, that is 1.100110011…₂ × 2⁻⁴. The exponent field is −4 + 1023 = 1019 = 01111111011. The mantissa keeps the 52 bits after the point, rounded to the nearest: 1001 1001 … 1001 1010 (the last bits round up). Put together: 0x3FB999999999999A.

What was actually stored. Those bits are exactly 0.1000000000000000055511151231257827021181583404541015625, about 5.55 × 10⁻¹⁸ more than 0.1. In single precision the nearest float is 0x3DCCCCCD = 0.100000001490116119384765625, an error of 1.49 × 10⁻⁹.

The common mistake: comparing floats with ==. 0.1 + 0.2 gives the double 0.3000000000000000444, but 0.3 is stored as 0.2999999999999999889, the next double down, so 0.1 + 0.2 == 0.3 is false. Compare with a tolerance, or use decimal or integer arithmetic for money.

Show Work

Enter a value to see the step-by-step working.

Formulas

Normal number
(−1)s × 1.f × 2e − bias
Subnormal
(−1)s × 0.f × 21 − bias
exponent field 0
Layouts
half 1+5+10 · single 1+8+23 · double 1+11+52
bias 15 · 127 · 1023
Machine epsilon
2−10 · 2−23 · 2−52
gap above 1.0
Rounding
nearest value, ties to even
error ≤ half a gap

One Standard for Every Chip

Before 1985 every computer maker had its own floating-point format, with different precision and rounding, so the same program could print different answers on different machines. The IEEE 754 standard, led by William Kahan, who received the Turing Award for it in 1989, fixed the formats and required correctly rounded arithmetic: every operation must give the nearest representable result. Intel’s 8087 coprocessor of 1980 had already implemented the draft.

The 2008 revision added the 16-bit half format, decimal floating point and fused multiply-add. Today IEEE 754 doubles are the number type of JavaScript and Python, and since the standard pins down every bit, a result can be checked exactly, as this converter does.

About This Calculator

This converter rounds any decimal, fraction or e-notation number to IEEE 754 half, single or double precision, correctly and exactly, and reads hex bit patterns back. It shows the bits split into sign, exponent and mantissa, the shortest decimal that round-trips, the full exact stored value, the rounding error, the neighbouring floats and the gap between them, and handles zero, subnormals, infinity and NaN.

Everything runs in your browser; nothing is sent anywhere. It does not use the browser’s own floating point to convert, so even inputs with hundreds of digits round correctly.

Related calculators: FP16 and bfloat16 Converter, ULP Explorer, and Binary Fraction Converter.

Frequently Asked Questions

Why is 0.1 + 0.2 not equal to 0.3?

0.1, 0.2 and 0.3 repeat for ever in binary, so each is stored as the nearest double. 0.1 is really 0.1000000000000000055511…, 0.2 is 0.200000000000000011102…, and their sum rounds to 0.3000000000000000444, one step above the double nearest 0.3, which is 0.2999999999999999889. They differ in the last bit, so the comparison fails.

How is a float stored?

As three fields: a sign bit, an exponent and a mantissa (the fraction). A normal number is (−1)^sign × 1.mantissa × 2^(exponent − bias). A double has 1 + 11 + 52 bits and a bias of 1023; a single float has 1 + 8 + 23 bits and a bias of 127. The leading 1 is not stored, which buys one extra bit of precision.

How precise is a double?

It has 53 significant bits, about 15 to 17 decimal digits. The gap between 1 and the next double is 2⁻⁵² ≈ 2.22 × 10⁻¹⁶ (machine epsilon). Every integer up to 2⁵³ = 9,007,199,254,740,992 is exact, but 2⁵³ + 1 is not: it is stored as 2⁵³. A single float has 24 bits, about 7 digits, so 16,777,217 becomes 16,777,216.

What are subnormal numbers, infinity and NaN?

An exponent field of all zeros means a subnormal number, smaller than the smallest normal one, which lets values fade gradually to zero; the smallest double is about 4.9 × 10⁻³²⁴. An exponent of all ones means infinity if the mantissa is zero, from overflow or dividing by zero, and NaN (not a number) otherwise, from 0/0 or the square root of −1.

What range can each format hold?

Half precision goes up to 65,504; single precision to about 3.4 × 10³⁸; double precision to about 1.8 × 10³⁰⁸. Anything larger becomes infinity. Half floats are common in graphics and machine learning, singles in games and GPUs, and doubles are the default number type in JavaScript, Python and most science code.

How do I use the IEEE 754 Float Converter?

Just type or paste your value. The answer shows up right away — there is no button to press. Change anything and it updates by itself.

Does it cost anything or need an account?

No. The tool is completely free, there is no account to create, and it keeps working offline after the page first loads.

Is anything I type uploaded?

No. The tool works entirely on your device, so the values you enter never leave your browser.

Common Use Cases

Debugging

0.1 in a double is 0x3FB999999999999A, really 0.1000000000000000055511151231257827.

Reading memory

0x40490FDB as a single float is 3.1415927, the float nearest π.

Precision limits

16,777,217 stored as a float becomes 16,777,216; 2⁵³ + 1 in a double becomes 2⁵³.

Half floats

65,504 is the largest half-precision value (0x7BFF); 65,520 rounds up to infinity.

Last updated: