1. Home
  2. Developer tools
  3. IEEE 754 Converter

IEEE 754 Converter

Type a number or a bit pattern and see the sign, exponent and mantissa of the single or double precision float it becomes. Click the bits to flip them and watch the value, or look at why 0.1 is not stored exactly.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use IEEE 754 Converter

  1. Choose 32-bit or 64-bit.
  2. Enter a decimal number, hex or the bits.
  3. Read the fields, the exact value and the nearest neighbours; click bits to edit them.

Features

  • Single (binary32) and double (binary64) precision
  • Colour-coded sign, exponent and mantissa bits you can click
  • Exact decimal expansion of the stored value
  • Infinity, NaN, zero, subnormal and normal numbers named
  • Previous and next representable numbers
  • Formula with the actual numbers filled in

Supported formats

Input

  • Decimal number
  • Hex
  • Bit pattern

You get

  • Sign, exponent, mantissa
  • Exact value
  • Hex

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the IEEE 754 Converter is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Only binary32 and binary64 are covered; half precision, 80-bit extended and decimal floating point are not.
  • NaN payload bits are shown but not interpreted.

Guide

How floating-point numbers are stored: IEEE 754 explained

Almost every programming language stores non-integer numbers in a format defined by the IEEE 754 standard. It packs a sign, an exponent and a fraction into 32 or 64 bits, and it is fast and compact, but it has surprises. This page opens the box: type a number, and you see the actual bits and the exact value they stand for.

Three fields

A float is a sign bit, a biased exponent, and a mantissa. The value is (−1)^sign × 1.mantissa × 2^(exponent − bias). The leading 1 is not stored, which is the “hidden bit” that gives one extra bit of precision. A single-precision number has 8 exponent bits with bias 127 and 23 mantissa bits; a double has 11 exponent bits with bias 1023 and 52 mantissa bits. The page colours the three groups and prints the formula with your numbers filled in.

Why decimals are not exact

A fraction can be written exactly in binary only if its denominator is a power of two. One tenth is not, so it has an endless binary expansion that is rounded to 53 significant bits in a double. The stored value of 0.1 is 0.1000000000000000055511151231257827…, a little above one tenth. The page prints this exact expansion, and also the shortest decimal string that reads back to the same double, which is why programs usually show 0.1.

Special values

When the exponent field is all ones, the number is infinity (mantissa zero) or not-a-number (mantissa non-zero). When the exponent is all zeros, the number is zero or subnormal, with no hidden bit, and the spacing between values becomes constant. Both a positive and a negative zero exist. The quick buttons on the page include −0, Infinity and the not-a-number value, so you can see their bit patterns.

Neighbours and flipping bits

Floating-point numbers are not evenly spaced: the gap doubles at every power of two. The buttons for the previous and next representable number show how far apart the neighbours are, and clicking a bit flips it and updates the value. Flipping the lowest mantissa bit is the quickest way to understand rounding error, and flipping an exponent bit shows how steeply the value scale changes.

A worked example

The double nearest to 0.1 has the hexadecimal form 3FB999999999999A. Its sign is 0, its exponent field is 01111111011 (1019, so the power is 2⁻⁴), and its mantissa is 1001 repeated, ending in 1010 after rounding. The single-precision value is 3DCCCCCD, whose exact value is 0.100000001490116119384765625. For the sum, the double of 0.3 is 3FD3333333333333 (exactly 0.29999999999999998889776975…) while 0.1 + 0.2 produces 3FD3333333333334, printed as 0.30000000000000004.

Limits

Only binary32 and binary64 are covered. Half precision, the 80-bit extended format of some processors, and the decimal formats of IEEE 754-2008 are not. The page converts one number at a time and does not simulate operations or rounding modes. A value typed as decimal is rounded to the nearest representable number, as a compiler would, and the page tells you the exact value that results. Bit patterns use the order of the displayed bits and ignore byte order.

Checked against the current version of the IEEE 754 Converter on .

Frequently asked questions

Why does 0.1 + 0.2 give 0.30000000000000004?

Neither 0.1 nor 0.2 is stored exactly. The two stored values add to a number that falls between two doubles, and the result is rounded to the nearer one, 0.3000000000000000444…, which is one step above the double that is nearest to 0.3. Printing with the shortest unique digits shows the difference.

What is the largest whole number a double can hold without gaps?

2 to the 53rd power, 9,007,199,254,740,992. Beyond it consecutive doubles are two or more apart, so some integers cannot be represented, and adding one can leave the value unchanged.

Why does 0.1 + 0.2 not equal 0.3?

Neither 0.1 nor 0.2 can be stored exactly in binary. Their stored values add up to 0.3000000000000000444…, which is a different double from the one nearest 0.3.

What is the largest integer a double holds exactly?

2^53 = 9,007,199,254,740,992. Above it, some integers are skipped because the 52-bit mantissa runs out of room.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.