ForHosting KIT · Unit converters

Float to IEEE-754 converter

3.14 in double precision is stored as 0x40091EB851EB851F: one sign bit, eleven exponent bits and 52 significand bits, each shown separately. Decode hex dumps back to decimals too, and spot zeros, subnormals, infinities and NaN at a glance. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Value
3.14
IEEE-754 width: 32
64
Conversion direction
From decimal
You get
Precision
64
Output format
binary64
Bits
64
Hex
40091EB851EB851F

Enter a decimal value such as 3.14 or minus one, choose single precision binary32 or double precision binary64, and the tool returns the canonical hexadecimal word, the full binary string, the sign bit, the biased exponent field, the significand bits, and a category label for normal numbers, subnormals, signed zeros, infinities, and NaN. You can also paste a hex dump or a bit string and decode it back to a decimal so firmware dumps, network traces, and textbook exercises all share one deterministic layout.

What a floating-point number really stores

Computers keep most decimal numbers in the standard floating-point format, which splits a fixed number of bits into three parts. The sign bit says whether the value is positive or negative. The exponent sets the scale and is stored with a fixed bias, so it never needs a sign of its own. The significand holds the digits, with an implicit leading one for normal numbers. Double precision spreads 64 bits as 1, 11 and 52; single precision packs everything into 32. The same layout also encodes special cases without any extra marker: signed zero, subnormal numbers that fill the gap near zero, infinity and NaN.

When to look at the bits, and common mistakes

Seeing the pattern helps when a value read from a firmware dump, a network capture or a file looks wrong, or when you teach why floating-point arithmetic behaves the way it does. Paste an eight-digit hex word for single precision or a sixteen-digit one for double precision and you get back the decimal and its category. Typical mistakes are choosing the wrong precision for the dump, reading the bytes in the opposite order (the hex here follows the usual big-endian memory layout, most significant byte first) and forgetting that the stored exponent includes the bias. Text that is not a number is rejected rather than guessed.

Teach sign, exponent, and significand fields

Show students the exact bit layout for textbook values, including normals, subnormals, signed zeros, infinities, and NaN, with deterministic steps for worksheets.

Decode hex dumps from firmware and captures

Paste an eight- or sixteen-digit hex word from a memory dump or packet and recover the decimal float plus category without writing a one-off script.

How do I convert a float to hex?

Send value with the decimal number and optional precision 32 or 64.

Can I decode hex back to a float?

Yes. Set hex to the bit pattern (optional 0x) and precision to match the width. The response value is the decoded decimal (or NaN / Infinity strings when applicable).

What is the difference between single and double precision?

Single precision (binary32) uses 32 bits: one sign bit, eight exponent bits and twenty-three significand bits. Double precision (binary64) uses 64 bits: one sign bit, eleven exponent bits with a bias of 1023, and 52 significand bits.

How are infinity and NaN stored?

Both use an exponent made entirely of ones. If the significand is all zeros, the value is infinity, positive or negative depending on the sign bit; if any significand bit is set, the value is NaN.

What does the biased exponent mean?

The stored exponent is the real exponent plus a fixed bias, which is 1023 in double precision. For 3.14 the stored exponent is 1024, so the real exponent is 1 once the bias is taken away.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/fmt/ieee754

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/fmt/ieee754 \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":3.14,"decimal":1}'
{
  "value": 3.14,
  "decimal": 1
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "fmt.ieee754",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_bits64
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

An IEEE-754 float converter shows the exact bit pattern a computer uses for a floating-point number. Non-numeric decimal text is rejected with invalid_input instead of being silently coerced.

What IEEE-754 binary32 and binary64 store

The same layout encodes special values without a separate tag: an all-ones exponent with a zero significand is signed infinity; an all-ones exponent with a nonzero significand is a NaN; an all-zero exponent with a zero significand is signed zero; an all-zero exponent with a nonzero significand is a subnormal number that fills the gap near zero. Engineers debugging serialization, teachers explaining floating-point error, and reverse engineers reading hex dumps all need to see that layout explicitly. IEEE-754 is the interchange format almost every modern CPU, GPU, and language runtime uses for binary floating-point arithmetic. A binary32 value occupies thirty-two bits: one sign bit, eight exponent bits with bias one hundred twenty-seven, and twenty-three explicit significand bits with an implicit leading one for normal numbers. A binary64 value occupies sixty-four bits: one sign bit, eleven exponent bits with bias one thousand twenty-three, and fifty-two significand bits. This capability does not invent a custom encoding: it uses the platform DataView big-endian float getters and setters so the hex string you get matches the conventional memory dump of a big-endian IEEE word, and the binary string is simply those bytes expanded bit by bit from most significant to least significant.

How to call the API and what comes back

Send a JSON body with at least one source field. To encode a decimal, set value (aliases decimal, number, n) to a finite number or to Infinity, minus Infinity, or NaN when those specials are representable in your client. To decode a bit pattern, set hex to an optional-0x hexadecimal string of up to eight digits for binary32 or sixteen for binary64, or set binary (alias bits) to a string of zeros and ones of matching length; shorter patterns are left-padded with zeros. Optional precision (aliases format, width) selects thirty-two or sixty-four bit width and accepts names such as single, double, binary32, and binary64; the default is sixty-four. Optional direction (alias mode) forces from_decimal, from_hex, or from_binary; auto picks from the fields present and prefers value when several are set. On success the response includes value (with string forms for NaN and infinities), is_neg_zero, precision, format name, bits, hex, hex_prefixed, binary, sign_bit, exponent_bits, mantissa_bits and significand_bits, sign as plus or minus one, biased_exponent, unbiased_exponent when defined, category, exponent_bias, source, message, and ordered steps. Failed validation—missing every source field, non-numeric decimal text, invalid hex digits, or non-binary characters—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.

Practical tips, limits, and related searches

Prefer precision sixty-four when your source is a JavaScript number or another binary64 host type, and switch to thirty-two only when you are matching float or float32 storage on the wire or in a file format. When round-tripping, encode a value then decode the returned hex with the same precision and confirm category and fields match. Keep patterns inside the published bit width; patterns longer than the selected precision are rejected rather than truncated, which would silently change the value. Remember that many decimals such as one tenth do not have a finite binary expansion; the hex you see is the correctly rounded IEEE encoding, not a bug. Use signed zero, infinity, and NaN examples when teaching specials: encoding zero and negative zero yields distinct sign bits and the categories pos_zero and neg_zero even though JSON prints both as zero and the tool exposes is_neg_zero for that case. This landing targets people searching for a float to IEEE-754 converter, single or double precision hex dump, or binary floating-point bit pattern tool; it is not a decimal-floating-point (decimal64) converter, not an arbitrary-precision calculator, and not a general hex-to-binary integer tool—use the sibling hex-to-binary capability when you only need integer base conversion. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners deliberately send garbage strings.

Debug binary serialization of floats

Confirm that a float written by one service matches the IEEE-754 hex another service reads, for both binary32 wire formats and binary64 JSON-adjacent dumps.

What is IEEE-754 binary64?

Binary64 is the 64-bit double-precision format: 1 sign bit, 11 exponent bits (bias 1023), and 52 significand bits. It is the format used by JavaScript Number and most CPUs for double values.

What happens on non-numeric input?

Decimal text that is not a number returns invalid_input and is not charged. Valid specials Infinity, -Infinity, and NaN are accepted as IEEE encodings.

Is the IEEE-754 converter free?

The browser tool is free and runs locally. API calls use prepaid KIT balance at $0.002 per successful request; failed tasks are never charged.

Read the full KIT documentation →