ieee 754 · float32 · float64 · hex · binary

Inspect a floating-point number

Switch a float to its IEEE 754 hex and binary representation, or go the other way. 32-bit and 64-bit modes. Big-endian byte order. Runs locally.

IEEE 754 Converter
Mode
f → hex
direction
Bits
32
single
Hex
4048f5c3
8 digits
Status
valid
live
Mode:
Bits:
input · float
Big-endian byte order · 4 bytes · 8 hex digits
output · representations
Float3.14
Hex4048f5c3
Binary01000000010010001111010111000011
Quick Start

How to read IEEE 754

Float32 packs sign (1 bit), exponent (8), mantissa (23). Float64 uses 1 + 11 + 52. The hex view shows the raw bytes.

  1. 01

    Pick direction

    Float → hex shows the bits behind a number; hex → float reverses it.

    Parsing is strict-but-tolerant — comments and trailing commas are accepted on input where the source format historically permits them; output stays canonical.

    modestricttolerantliveparse
    mode · sourcef→h · live
    float-to-hex
    loaded · parsedtarget · ready
  2. 02

    Pick precision

    32-bit single (float) or 64-bit double for higher precision.

    Conversion preserves type information where the target supports it (numbers stay numeric, booleans stay boolean) so the destination parser never has to re-coerce.

    bitstype-preservinglosslesslivememoised
    bits · options32 · live
    single 32
    options applied · liveround-trip
  3. 03

    Type the value

    Float side accepts NaN, Infinity, -0. Hex side accepts 0x prefix.

    Re-encoding is idempotent: running output back through the same converter produces the same bytes, which keeps round-trips git-friendly.

    inputidempotentround-tripdiff-cleandeterministic
    input · converted3.14 · ready
    3.14
    converted · livediff-clean
  4. 04

    Read every form

    Float decimal, hex bytes, full binary expansion.

    Copy writes via navigator.clipboard.writeText; downloads use the target’s native MIME so editors apply the right syntax highlighting on open.

    readclipboardtarget MIMEblobclient-side
    ✓ · copiedbinary · done
    010000000100…
    decoded · ready to shipsuccess
Pro tips

Converting between formats, safely

Pick the strictest source format

Lossy formats hide bugs. Choose JSON or YAML as your source-of-truth, convert downstream as needed.

Round-trip in CI

If your converter is idempotent, your CI can verify A → B → A equals the original. Catches subtle data loss.

Numbers vs strings differ

YAML/TOML have a number type; CSV doesn’t. Quote IDs in CSV to keep leading-zero values intact.

Watch character encoding

Source format may be Latin-1 / Windows-1252; target should be UTF-8. Convert encoding before structure.

Preserve comments where you can

YAML and TOML support comments. Don’t silently drop them — they often encode intent.

Schema-aware beats blind

Use a schema to guide conversion. Field types, required-ness, and defaults survive better with structure.

Use Cases

When to peek at IEEE 754

Debugging precision bugs, networking, embedded.

Precision debugging

Spot why 0.1 + 0.2 != 0.3 — see the exact bits. Type information survives: numbers stay numeric, booleans stay boolean, strings stay strings. The destination parser doesn't have to re-coerce, which avoids the "'true' becomes "true"" bug class.

round-trip safe

Wire formats

Decode binary protocols that carry floats. Run output back through the inverse converter to verify idempotent round-trips in CI. A → B → A should produce byte-identical input — if it doesn't, you've found data loss.

type-preserving

Embedded firmware

Match sensor byte payloads to readable numbers. Comments and metadata survive where the target format supports them (YAML, TOML, HCL). The tool doesn't silently drop intent-encoded annotations, which keeps your config self-documenting.

schema-aware

GPU shaders

Inspect half/float values dumped from buffers. Pair with a schema (JSON Schema, OpenAPI, Zod, Pydantic) to catch shape drift on either side. Catch breaking changes at conversion time rather than at runtime in production.

lossless

Numeric tests

Compare expected hex bits against observed. Output respects target-format conventions: quoting in CSV, indent in YAML, brackets in JSON. Existing parsers don't need patches, and the result drops into legacy pipelines unchanged.

diff-clean

Cross-language

Match Python's struct.pack output to JS DataView. Encoding-aware: handles UTF-8 vs UTF-16 vs Latin-1 / Windows-1252 transparently. The character-set surprise that breaks "works on my machine" doesn't apply here.

spec-grade
FAQ

Frequently asked questions

Hex output is big-endian network order. If you're reading little-endian bytes (most CPUs), reverse byte-pairs before pasting.
The float32 representation of π to single precision.
Both supported — denormals show as their actual bit pattern; NaN payload varies between platforms.
Float32 has ~7 significant decimal digits because 2^23 ≈ 10^7.
No. DataView runs in your browser.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!