IEEE 754 floating-point converter
See for yourself why 0.1 is not quite 0.1 inside a computer.
Bits
■ sign · ■ exponent · ■ mantissa
How to use
- Enter a number (0.1, -1e-7, Infinity) or hex bits, and choose the input and size.
- Sign, exponent and mantissa bits are shown in color.
- "Exact stored value" shows every digit the computer really holds.
Questions
Why is 0.1 + 0.2 = 0.30000000000000004?
Neither 0.1 nor 0.2 has an exact binary form, so each is stored as the nearest double; the tiny errors add up and show in the result.
32-bit vs 64-bit?
Single precision keeps about 7 significant digits, double about 15–17. JavaScript numbers are doubles.
Is there only one NaN?
No, many bit patterns are NaN; this shows the one your browser produces.
Is my input saved or sent?
No. It is processed in your browser only.
Related tools
- Password generatorStrong random passwords from your browser's cryptographic random generator. Choose length and character sets.
- Unix timestamp converterUnix timestamps (seconds or milliseconds) to dates in several time zones, and dates back to timestamps.
- Base64 encode / decodeEncode text to Base64 and decode Base64 back to text, with full UTF-8 (Korean, Japanese, emoji) and URL-safe output.
- URL encode / decodePercent-encode text or URLs and decode %XX sequences back to readable text, with a table of query parameters.
- JSON formatter & validatorPretty-print or minify JSON, sort keys, and see exactly which line and column a syntax error is on.
- UUID generatorGenerate UUID v4 (random) or v7 (time-ordered) in bulk, upper or lower case, with or without hyphens.