IEEE 754 Float Converter — decimal, hex and bit fields
Convert between decimal, hex and binary float32/float64, with the sign, exponent and mantissa fields broken out.
Example: 3.14 as float32 is 0x4048F5C3 — sign 0, exponent 128 (1), normal.
Check it against real silicon
Chiprun runs your firmware on an emulated microcontroller and hands back the UART output, so you can confirm these numbers rather than trusting them.
Formula
value = (−1)^sign × 1.mantissa × 2^(exponent − bias)Calculations follow IEEE 754-2019.
Worked example
3.14 as float32 is 0x4048F5C3 — sign 0, exponent 128 (1), normal.
bit layout
1 sign + 8 exponent + 23 mantissa = 32 bits
0 10000000 10010001111010111000011
unbiased exponent = raw − bias
128 − 127
1
The bias lets a plain unsigned field represent negative exponents.
value = (−1)^sign × 1.mantissa × 2^exponent
(−1)^0 × 1.10010001111010111000011 × 2^1
3.140000104904175
Frequently asked questions
Why is 0.1 + 0.2 not exactly 0.3?
Because 0.1 and 0.2 have no exact binary representation, in the same way 1/3 has no exact decimal one. Each is stored as the nearest representable value, and the small errors accumulate. Convert 0.1 above to see the stored value differ from what you typed.
What is 0x3F800000?
The float32 encoding of 1.0 — sign 0, exponent 127 (unbiased 0), mantissa all zeros, giving 1.0 × 2⁰. It is worth memorising, because seeing it in a memory dump immediately tells you that you are looking at floats.
What is the difference between float32 and float64?
float32 uses 8 exponent bits and 23 mantissa bits for roughly 7 decimal digits of precision; float64 uses 11 and 52 for about 16. On a microcontroller without a double-precision FPU, float64 arithmetic is emulated in software and dramatically slower.
Why does NaN not equal itself?
The standard defines it that way, so that any comparison involving NaN is false. It gives you a reliable test — x !== x is true only for NaN — and it is why sorting an array containing NaN produces unpredictable order.
Related tools
Hex, Binary & Decimal Converter
Convert between hex, binary, decimal, octal and ASCII, with width-aware bit grids and endianness swapping.
Firmware
Two's Complement Calculator
Signed and unsigned interpretation at any register width, with overflow and carry flags.
Firmware
Bitwise Operation Calculator
AND, OR, XOR, NOT and shifts with a live bit grid so you can see exactly which bits moved.
Firmware
C Struct Padding Calculator
Paste a C struct to see member offsets, inserted padding and total size for 32-bit and 64-bit targets — and how to reorder it smaller.
Firmware
CRC Calculator
CRC-8, CRC-16 (CCITT, Modbus, XMODEM) and CRC-32 over hex or ASCII input, with the polynomial and shift steps explained.
Firmware
PWM Frequency & Duty Calculator
The frequency-versus-resolution trade-off made explicit, with register values for your MCU and duty-cycle counts.
Firmware