Zero Signup ToolsFree browser tools

Developer Tools

IEEE 754 Converter

Convert any decimal number to its IEEE 754 binary32 or binary64 bit pattern, and decode any 32-bit or 64-bit hex or binary value back to its float value.

IEEE 754 floating point converter

Precision

Pick the IEEE 754 format. binary32 is the C float; binary64 is the C double and the JavaScript number.

Decimal to IEEE 754

Type a decimal number, scientific notation, Infinity, -Infinity, or NaN. The IEEE 754 bit pattern updates as you type.

Try:

Decoded value

3.141592653589793

Normal number. Implicit leading 1 on the mantissa, unbiased exponent 1.

Normal
Sign01
Exponent1000000000011
Mantissa100100100001111110110101010001000100001011010001100052
Sign bit

0

Positive (+)

Exponent (11 bits)

10000000000

Raw 1024, bias 1023, unbiased 1.

Mantissa (52 bits)

1001001000011111101101010100010001000010110100011000

Implicit leading bit 1 in the value.

Hex (16 digits)

0x400921FB54442D18

Binary (64 bits)

0100000000001001001000011111101101010100010001000010110100011000

Hex / binary to decimal

Paste a hex pattern (with or without 0x) or a string of 0/1 bits (with or without 0b). The leading zeros may be omitted; the tool fills to 64 bits.

Showing the bit pattern of the decimal value above. Type any hex or binary value to override.

Try:

Decoded value

3.141592653589793

Normal number. Implicit leading 1 on the mantissa, unbiased exponent 1.

Normal
Sign01
Exponent1000000000011
Mantissa100100100001111110110101010001000100001011010001100052
Sign bit

0

Positive (+)

Exponent (11 bits)

10000000000

Raw 1024, bias 1023, unbiased 1.

Mantissa (52 bits)

1001001000011111101101010100010001000010110100011000

Implicit leading bit 1 in the value.

Hex (16 digits)

0x400921FB54442D18

Binary (64 bits)

0100000000001001001000011111101101010100010001000010110100011000

IEEE 754 format

  • The leftmost bit is the sign: 0 for non-negative, 1 for negative. Both +0 and -0 are valid distinct bit patterns that compare equal.
  • The next field is the biased exponent. binary32 uses 8 bits and a bias of 127. binary64 uses 11 bits and a bias of 1023.
  • The remaining bits are the mantissa (also called the fraction). For a normal value the actual significand is 1.fraction; for a subnormal it is 0.fraction.
  • An exponent of all ones with a zero mantissa is infinity; with a non-zero mantissa it is a NaN. The leading mantissa bit signals the quiet/signaling distinction.

Why this matters

  • The decimal 0.1 has no exact binary representation, so 0.1 + 0.2 produces 0.30000000000000004 in JavaScript and most other languages. The bit view explains exactly where the extra bits come from.
  • Subnormals trade precision for the ability to represent values smaller than the smallest normal float. Some CPUs flush them to zero for speed.
  • JavaScript numbers are always binary64. C float is binary32; double is binary64. CUDA, GLSL, and Rust use the same two formats.
  • Comparing IEEE 754 values is not always intuitive: NaN compares not equal to anything (including itself), and -0 == +0 but the bit patterns differ.

How to use

  1. Pick a precision. binary64 is the JavaScript number, a C double, and the default for most languages. binary32 is the C float and the GPU shader float.
  2. Type a decimal value into the top field: 0.1, 3.14, 1e10, 2.5E-3, Infinity, -Infinity, or NaN. The IEEE 754 bit pattern updates as you type, with the sign, exponent, and mantissa shown as a colored grid plus hex and binary readouts.
  3. Read the classification chip and summary line to see whether the value is a normal number, a subnormal, a zero (plus/minus), an infinity, or a NaN, plus the unbiased exponent and the implicit leading bit.
  4. To go the other way, paste a hex value (8 digits for binary32, 16 for binary64) or a binary string (32 or 64 bits) into the second field, with or without a 0x or 0b prefix. The decoded decimal appears with the same bit visualization.
  5. Use the Send to bits and Send to decimal buttons to copy a value between the two fields, or click Copy next to any sign, exponent, mantissa, hex, or binary readout to grab just that piece.

About this tool

IEEE 754 Converter turns any decimal number into its IEEE 754 bit pattern, and any 32-bit or 64-bit hex or binary value back into the decimal it represents. Both single-precision (binary32, a C float) and double-precision (binary64, a C double and the JavaScript number) are supported. Conversion uses the platform's native Float32Array and Float64Array views over a shared ArrayBuffer, so the bit pattern you see is exactly the pattern your CPU, compiler, and runtime use; there is no hand-rolled rounding step that could disagree with the hardware. Every result is decomposed into the three IEEE 754 fields and rendered as a colored bit grid: the sign bit, the biased exponent (8 bits with bias 127 for binary32, 11 bits with bias 1023 for binary64), and the mantissa (23 bits or 52 bits). Numerical helpers print the raw exponent, the bias, and the unbiased exponent so you can see how the standard composes the value 1.mantissa multiplied by 2 to the unbiased exponent for normal numbers and 0.mantissa multiplied by 2 to (1 - bias) for subnormals. The classifier identifies the four cases the standard recognizes: zero (both positive and negative zero are distinct bit patterns), subnormal (also called denormalized; exponent is zero and the implicit leading bit drops to 0), normal (the common case), and the exponent-all-ones family (positive infinity, negative infinity, quiet NaN, signaling NaN). The decoded value re-emerges through the same Float32Array or Float64Array view, so the round trip is bit-exact: any pattern you paste in produces the exact float a CPU would load from that memory, and any decimal you type produces the bit pattern the CPU would store after a normal floating-point assignment. Useful when you are debugging 0.1 + 0.2 weirdness, reading a Wireshark dump, writing a binary protocol, comparing two compilers' rounding behavior, studying numerical analysis or computer architecture for a class, or just curious why JavaScript thinks 0.1 + 0.2 is 0.30000000000000004. Everything runs locally in your browser; the numbers you experiment with never leave your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools