Home › Developer Tools › IEEE 754 Floating Point Converter

IEEE 754 Floating Point Converter

Type a decimal number to see exactly how it is stored as an IEEE 754 single (32-bit), double (64-bit) or half (16-bit) float. Click any bit to flip it, paste hex or binary to decode it, and see the exact stored value and the rounding error.

Last updated:

Try:
SignExponent Mantissa Click a bit to flip it
Advertisement
Advertisement

How to use the IEEE 754 Floating Point Converter

  1. Pick the precision: 32-bit single (C float), 64-bit double (JavaScript number, C double) or 16-bit half.
  2. Enter a decimal number such as 0.1, -2.5e-8 or 3.14159. Infinity, -0 and NaN work too.
  3. Read the bits: the sign, exponent and mantissa are colored, and the hex and binary forms appear underneath.
  4. Check the rounding error: the tool shows the exact value stored and how far it is from what you typed.
  5. Experiment: click any bit to flip it, paste a hex pattern like 3DCCCCCD, or use the ±1 ULP buttons to walk to neighboring floats.

IEEE 754 formats at a glance

Half (binary16)Single (binary32)Double (binary64)
Total bits163264
Sign / exponent / fraction1 / 5 / 101 / 8 / 231 / 11 / 52
Exponent bias151271023
Significant decimal digitsabout 3.3about 7.2about 15.9
Largest finite value65504≈ 3.4028235 × 1038≈ 1.7976931 × 10308
Smallest positive normal≈ 6.10 × 10-5≈ 1.18 × 10-38≈ 2.23 × 10-308
Smallest positive subnormal≈ 5.96 × 10-8≈ 1.40 × 10-45≈ 4.94 × 10-324
Machine epsilon (ULP of 1.0)2-10 ≈ 9.77 × 10-42-23 ≈ 1.19 × 10-72-52 ≈ 2.22 × 10-16
Typical namesfloat16, fp16, halffloat, f32, REALdouble, f64, JavaScript number

How to decode the bits by hand

For a normal number the value is (-1)sign × 1.fraction × 2exponent − bias. Take 0.1 as a single-precision float, hex 3DCCCCCD:

  1. Binary: 0 01111011 10011001100110011001101.
  2. Sign bit 0, so the number is positive.
  3. Exponent field 01111011 = 123; subtract the bias 127 to get −4.
  4. The fraction with the implicit leading 1 is 1.100110011001100110011012 ≈ 1.6000000238.
  5. Value = 1.6000000238 × 2−4 = 0.100000001490116119384765625, which is 1.49 × 10−9 above 0.1.

Special patterns: an exponent field of all zeros means zero or a subnormal number (no implicit 1, exponent fixed at 1 − bias); all ones means infinity when the fraction is zero and NaN otherwise.

Common values

ValueSingle (hex)Double (hex)
1.03F8000003FF0000000000000
0.53F0000003FE0000000000000
0.13DCCCCCD3FB999999999999A
−2.5C0200000C004000000000000
+0 / −000000000 / 800000000000000000000000 / 8000000000000000
+Infinity7F8000007FF0000000000000
NaN (quiet)7FC000007FF8000000000000

Frequently asked questions

Why is 0.1 not exactly 0.1 in floating point?

0.1 has an infinitely repeating binary expansion (0.000110011001100…), just like 1/3 in decimal, so it must be rounded to the nearest value with 24 (single) or 53 (double) significant bits. As a double it is stored as exactly 0.1000000000000000055511151231257827… (55 significant digits in full), an error of about 5.55e-18.

How is a 32-bit float laid out?

A single-precision float has 1 sign bit, 8 exponent bits stored with a bias of 127, and 23 fraction bits. For normal numbers the value is (-1)^sign × 1.fraction × 2^(exponent - 127). A double has 1 sign bit, 11 exponent bits with a bias of 1023, and 52 fraction bits.

What is the hex representation of a float?

It is the 32 or 64 raw bits written as 8 or 16 hexadecimal digits, most significant first. For example 1.0 is 3F800000 as a float and 3FF0000000000000 as a double, and 0.1 is 3DCCCCCD as a float. This is the value you see in memory dumps (in big-endian order) or when using functions like Float.floatToIntBits.

What are subnormal (denormal) numbers?

When the exponent field is all zeros, the implicit leading 1 becomes 0 and the exponent is fixed at its minimum, which lets very small values fade gradually to zero. The smallest positive subnormal is about 1.4e-45 for single precision and 4.9e-324 for double precision.

How does IEEE 754 rounding work?

The default mode is round to nearest, ties to even: the exact value is rounded to the closest representable float, and if it lies exactly halfway between two floats the one whose last mantissa bit is 0 is chosen. This converter performs that rounding with exact integer arithmetic, so the result matches what a correct compiler or parseFloat produces.

What is the difference between positive and negative zero?

They differ only in the sign bit (00000000 vs 80000000 for single precision). They compare equal, but they behave differently in some operations, for example 1/+0 is +Infinity and 1/-0 is -Infinity.

What is a ULP?

A unit in the last place is the gap between a float and the next representable float. It grows with the exponent: for doubles near 1.0 it is 2^-52, about 2.22e-16, which is the familiar machine epsilon.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.Binary CalculatorAdd, subtract, multiply, divide, AND, OR, XOR and shift binary numbers with decimal values.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.CSV to JSONConvert CSV data to JSON with live preview.Excel to CSVConvert XLSX spreadsheets to CSV.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.JSON to Go StructTurn JSON into Go structs with inferred types, nested structs and json tags.JSON to Python ClassGenerate Python dataclasses, Pydantic models or TypedDicts with type hints from JSON.JSON to C# ClassConvert JSON to C# classes or records with System.Text.Json or Newtonsoft attributes.Endianness ConverterSwap byte order of 16, 32 and 64-bit hex values and see big- and little-endian integers and floats.Excel to SQL ConverterTurn an Excel sheet into CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.Excel to VCF ConverterTurn an Excel contact list into a vCard .vcf file for iPhone, Android, Google or Outlook.File to C ArrayConvert any file into a C or C++ byte array header, like xxd -i, with const and PROGMEM options.Image to C ArrayConvert images to monochrome, RGB565 or RGB888 C arrays for OLED, LCD and TFT displays.JSON Merge ToolDeep-merge two or more JSON objects with array concat, replace or union and a conflict rule.JSONL to CSV ConverterConvert JSON Lines / NDJSON to CSV with flattened columns; streams large files locally.PHP Unserialize OnlineDecode PHP serialize() strings to JSON, a tree or print_r, and serialize JSON back to PHP.SQL Dialect ConverterTranslate SQL between MySQL, PostgreSQL, SQLite, SQL Server, Oracle, BigQuery and more.TSV to JSON ConverterTurn tab-separated data pasted from Excel or Sheets into a JSON array or keyed object.XLS to XLSX ConverterConvert old Excel 97-2003 .xls workbooks to modern .xlsx files in your browser, several at once.XML to Excel ConverterTurn repeating XML elements into an .xlsx spreadsheet with attributes and nested data as columns.XSD to XML Sample GeneratorGenerate a sample XML document from an XSD schema, with types, attributes and namespaces.YAML to CSV ConverterTurn a YAML list of objects into CSV with dot-notation columns, custom column order and download.DOCX to Markdown ConverterConvert Word .docx to clean Markdown with headings, lists, tables, links and images in a ZIP.ES6 to ES5 ConverterTranspile modern JavaScript (ES2015+) to ES5 with Babel: targets, module format and loose mode.JavaScript Object to JSONTurn JS object literals and Python dicts into valid JSON: quotes keys, fixes commas and values.JSON Graph VisualizerSee JSON as an interactive node graph with zoom, collapse and search; export PNG or SVG.KML ViewerOpen KML and KMZ files on an interactive map: placemarks, paths, polygons, folders, export.MySQL to PostgreSQL ConverterConvert MySQL dumps and CREATE TABLE statements to PostgreSQL: types, AUTO_INCREMENT, ENUMs, quotes.Text to CSV ConverterTurn space-aligned, fixed-width, pipe or tab separated text into clean CSV with a live preview.VCF File ViewerOpen vCard .vcf files as contact cards with photos, search and duplicate check, export CSV.XML ViewerBrowse XML as a collapsible tree with search, XPath of any node, attributes and big-file support.JSON SorterSort JSON keys A-Z recursively, sort arrays by value or by a key, then pretty-print or minify.JSON to HTML TableConvert a JSON array of objects into clean HTML table code with CSS styles and a live preview.CSV to SQL ConverterConvert CSV to SQL CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.IPv4 to IPv6 ConverterConvert IPv4 to IPv4-mapped, 6to4 and NAT64 IPv6, extract IPv4 from IPv6, and get int/hex/binary.cURL to Code ConverterConvert curl commands to JavaScript fetch, Axios, Python requests, Node.js, PHP and Go code.Code to ImageTurn code into a beautiful syntax-highlighted PNG with themes, window frame and background.Excel to JSON ConverterConvert Excel sheets (XLSX, XLS, ODS) to JSON with header row, type and shape options.
See all 129 Data & File Format Converters →