Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Convert a decimal to half, single or double precision floating point, flip individual bits, and read the exact stored value with its rounding error.
Click any bit to flip it. Black is the sign bit, the outlined group is the 8 bit exponent and the filled group is the 23 bit mantissa.
Click a row to copy that value to your clipboard.
An IEEE 754 converter is a browser tool that encodes a decimal number into the binary floating point layout a CPU actually stores, and decodes a raw bit pattern back into a number. It splits every value into a sign bit, an exponent field and a mantissa field, following IEEE 754-2019.
That standard was published on 22 July 2019 and supersedes IEEE 754-2008. TestMu AI runs the encoder in the page. All processing happens in your browser. No data is uploaded.
For plain integer bases without an exponent field, the Decimal to Binary and Decimal to Hex tools are quicker.
A normal number is stored as (-1)^sign x 1.fraction x 2^(rawExponent - bias). The leading 1 is implied and never stored, which buys one extra bit of precision. The bias is 15 for binary16, 127 for binary32 and 1023 for binary64.
The encoder here works in exact integer arithmetic. It decomposes your decimal into a significand and a power of two, chooses the quantum exponent for the target format, then rounds with round to nearest, ties to even, the default rounding attribute in IEEE 754-2019. That is why the bit pattern matches what your compiler produces.
Two exponent values are reserved. An all zero exponent means zero or a subnormal, where the implicit leading 1 is dropped so values can shrink gradually toward zero. An all ones exponent means infinity when the mantissa is zero and NaN when it is not.
The widget supports three interchange formats, three input modes and a ten row field breakdown where clicking any row copies it. These are the controls you get in this tab:
All three share the same sign, exponent and mantissa layout and differ only in field widths. Wider fields buy range and precision at the cost of memory and bandwidth.
| binary16 (half) | binary32 (single) | binary64 (double) |
|---|---|---|
| 1 sign, 5 exponent, 10 mantissa | 1 sign, 8 exponent, 23 mantissa | 1 sign, 11 exponent, 52 mantissa |
| Bias 15 | Bias 127 | Bias 1023 |
| 11 bits of precision | 24 bits of precision | 53 bits of precision |
| About 3 decimal digits | About 7 decimal digits | About 15 to 17 decimal digits |
| Max finite 65504 | Max finite about 3.4 times 10^38 | Max finite about 1.8 times 10^308 |
| GPU weights, HDR pixels | C float, GLSL, audio buffers | C double, JavaScript numbers, JSON |
JavaScript exposes only binary64, which is why every number literal in a JSON payload lands on the double grid. Inspect the raw bytes of any of these with the Hex to Binary converter, or shift a pattern with the Bit Shift Calculator.
Whenever a number crosses a boundary between two systems that store it differently. The common jobs:
Rounding defects usually surface as flaky numeric assertions. Group and triage those runs in TestMu AI Test Intelligence, and confirm the same arithmetic across engines on Real Device Cloud with 10,000+ real devices and 3000+ browsers. To check a two's complement integer instead, use the Binary Calculator.
Because 0.1 is 1/10 and 10 has the prime factor 5, which no power of two can express. Binary can only represent fractions whose denominator is a power of two, so 0.1 becomes a repeating binary fraction that gets cut off. In binary32 the nearest stored value is 0.100000001490116119384765625.
Each operand is already rounded before the addition happens, and the sum is rounded again. In binary64 the result is 0.3000000000000000444089209850062616169452667236328125, which prints as 0.30000000000000004. Encode 0.1, 0.2 and 0.3 in this tool and compare the exact stored values to see the gap.
binary32 uses 1 sign bit, 8 exponent bits and 23 mantissa bits, giving 24 bits of precision and about 7 decimal digits. binary64 uses 1 sign bit, 11 exponent bits and 52 mantissa bits, giving 53 bits of precision and about 15 to 17 decimal digits. Both are defined in IEEE 754-2019.
The bias is a constant added to the real exponent so the stored field is always a non negative integer. It is 15 for binary16, 127 for binary32 and 1023 for binary64. Subtract the bias from the raw exponent field to get the real power of two, which this tool prints on the exponent row.
A subnormal number has an all zero exponent field and a non zero mantissa. The implicit leading 1 is dropped and the exponent is fixed at the minimum, which lets values smaller than the smallest normal shrink gradually toward zero. This behaviour is called gradual underflow and it avoids a sudden jump to zero.
Both use an all ones exponent field. If the mantissa is zero the value is infinity, with the sign bit choosing positive or negative. If the mantissa is non zero the value is NaN, and the top mantissa bit distinguishes a quiet NaN from a signaling NaN. This tool labels each case on the value class row.
The sign bit is stored separately from the magnitude, so a zero magnitude can carry either sign. They compare as equal, but they behave differently in division: 1 divided by positive zero is positive infinity, while 1 divided by negative zero is negative infinity. The sign also survives through operations that underflow.
Round to nearest, ties to even, which is the default rounding attribute in IEEE 754-2019. When a decimal sits exactly halfway between two representable values the encoder picks the one with an even last mantissa bit. That is the same rule your CPU applies, so the bit pattern matches what your program would store.
A ULP is the unit in the last place, the gap between one representable number and the next at that magnitude. It doubles every time the exponent increases, so precision is dense near zero and sparse near the maximum. The tool prints the exact ULP for the current value and lets you step one ULP at a time.
Yes. Paste the raw hex into the hex field, for example 3DCCCCCD in binary32 mode, and the decimal, bit grid and field breakdown all update. The raw binary field accepts the same value as a bit string. Both directions use the same encoder, so a round trip returns the original pattern.
Use a decimal or integer minor unit type for money. Binary floating point cannot store 0.01 or 0.1 exactly, so repeated addition accumulates a visible error. Store amounts as integer cents, or use a decimal type such as SQL NUMERIC, and reserve binary floating point for measurements and scientific values.
The largest finite binary64 value is about 1.7976931348623157 times 10 to the power 308, stored as 7FEFFFFFFFFFFFFF. Anything larger rounds to infinity. Press the Sample icon until Max finite loads to read that exact bit pattern and its full decimal expansion.
They round the same real number to different grids. binary32 has 24 bits of precision and binary64 has 53, so the nearest representable neighbour differs. The precision comparison panel encodes your decimal in all three formats at once and prints the absolute error for each so the tradeoff is visible.
Did you find this page helpful?
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance