IEEE 754 converter
This IEEE 754 converter turns a decimal number into the 16, 32 or 64-bit pattern and shows sign, exponent, mantissa, the exact stored value and the rounding error. You can also enter hex or bits.
Source: Wikipedia – IEEE 754 (Formate, Bias, subnormale Zahlen, Sonderwerte). Updated: .
How it is calculated
A floating-point number consists of a sign s, an exponent e and a mantissa m: value = (−1)^s · 2^(e − bias) · 1.m. The decimal 0.1 becomes 0x3DCCCCCD as a float and is stored as 0.100000001490116119384765625.
The three formats
- Half (binary16): 1 sign bit, 5 exponent bits (bias 15), 10 mantissa bits
- Single (binary32, float): 1, 8 (bias 127) and 23 bits
- Double (binary64): 1, 11 (bias 1023) and 52 bits
Why 0.1 is not exact
Floating-point numbers store powers of two, but 0.1 is a repeating fraction in binary. It is therefore rounded, and 0.1 + 0.2 gives 0.30000000000000004. The converter shows the exact stored decimal value and the rounding error.
Special values
If all exponent bits are 1, the number is infinity (mantissa 0) or NaN (mantissa not 0). If all exponent bits are 0, the number is zero or subnormal, stored without the leading one.
Frequently asked questions
How do you convert a decimal number to IEEE 754?
Split it into a sign, a base-2 exponent and a mantissa and store them in 8 + 23 bits (float) or 11 + 52 bits (double). The converter does this and shows hex and bits.
Why is 0.1 as a float not exactly 0.1?
0.1 is an infinite fraction in binary and has to be rounded. As a float that gives 0.100000001490116…, as a double 0.1000000000000000055….
What do the bits of a float mean?
The first bit is the sign, the next 8 bits the exponent with bias 127 and the last 23 bits the mantissa without the leading one.
Sources and legal basis
- Wikipedia – IEEE 754 (Formate, Bias, subnormale Zahlen, Sonderwerte)
- Wikipedia – IEEE 754 (binary16, binary32, binary64)
As of: · Editorial policy
Related tools
- Number base converter with stepsConvert between binary, octal, decimal, hex and any base from 2 to 36 – with full working, fractions, repeating digits and two’s complement (8–64 bit).
- Binary Calculator with StepsBinary calculator online: add, subtract, multiply, divide and combine binary numbers with AND, OR, XOR – result also in decimal, hex and two’s complement.
- Scientific Notation Converter with StepsConvert numbers to and from scientific notation: a × 10ⁿ, E notation, engineering notation with SI prefixes and standard form – exact, step by step.
- Significant Figures CalculatorCount significant figures, round to n sig figs and apply the rules for multiplying and adding – with highlighted digits, full working and scientific notation.
- Text to binary converter (and binary to text)Convert text to binary, hex, decimal or octal and translate binary back to text – with UTF-8 for accents and emoji, right in your browser, nothing uploaded.
- ASCII table with decimal, hex, octal, binary and Unicode lookupASCII table 0–127 plus Latin-1 and Windows-1252: decimal, hex, octal, binary, HTML entity, control codes. Search it, click to copy, convert text to codes.
- What is my IP address?What is my IP? See your public IPv4 or IPv6 address at once, plus approximate location, internet provider and browser details. Free, never stored.
- Cron expression generator and explainerCron expression generator and explainer: build or paste an expression, read it in plain words and see the next run times. Unix cron, Spring and Quartz, local.
- Chmod CalculatorChmod calculator: tick the permissions or type 755, rwxr-xr-x or u=rwx and see every notation at once, plus the command to copy. Free, runs in your browser.