EditSafely

Convert a Floating Point Number to Hex

Find the hex representation of a floating-point number. Runs entirely in your browser, so your data never leaves your device.

0 chars · 0 lines

Output

The result appears here as you type.

Options

How to use Convert a Floating Point Number to Hex

  1. 1. Type the number. Enter a decimal floating-point value into the input pane, like 1, -0.5 or 3.14159. Scientific notation works too, so 1e-3 is a perfectly good input.
  2. 2. Pick a Precision. Choose 64-bit (double) to see the eight-byte IEEE 754 encoding most languages use for their default float type, or 32-bit (single) for the four-byte layout used by GPUs, C floats and many wire formats.
  3. 3. Copy the hex encoding. The output pane shows the raw bit pattern as hex, for example 3ff0000000000000 for 1.0 as a double. Copy it into your test fixture, debugger or protocol spec.

When to use Convert a Floating Point Number to Hex

Convert a Floating Point Number to Hex shows you the exact IEEE 754 bit pattern behind a decimal value. That matters whenever floats leave the language runtime: binary file formats, network protocols, hardware registers and low-level debugging all deal in the raw bytes rather than the printed number.

  • Writing binary protocol test vectors. Your parser reads doubles from a byte stream. Encode known values like 1, -2.5 and 0.1 here and hardcode the hex into unit tests so failures point at real byte-level bugs.
  • Inspecting a float in a hex dump. You found eight suspicious bytes in a core dump where a sensor reading should be. Encode the value you expected and compare patterns to confirm whether the field holds what you think.
  • Explaining why 0.1 is inexact. Encode 0.1 as a double and show a colleague the repeating cccccccc pattern in the mantissa. The hex makes the classic floating-point rounding discussion concrete instead of hand-wavy.
  • Preparing constants for embedded code. A microcontroller project stores calibration factors as raw 32-bit words in flash. Use the single precision mode to get the exact word to place in the linker script or config blob.

Examples

One (double)

Input

1

Output

3ff0000000000000

Pi (double)

Input

3.14159

Output

400921f9f01b866e

About the Convert a Floating Point Number to Hex tool

Convert a Floating Point Number to Hex runs as plain JavaScript in your browser tab, with no server behind it. Find the hex representation of a floating-point number. Whatever you put in stays on your device from start to finish.

The tool is part of EditSafely's Hex Tools section, 108 single-purpose utilities built around the same idea: open the page, get the result, keep your data to yourself.

You can shape the output with the Precision setting, and the result refreshes the moment you change it. 2 worked examples further down the page show exactly what the tool produces for real inputs.

That local-first design has practical benefits beyond privacy. The tool keeps working on a flaky connection once the page has loaded, results are instant because nothing round-trips to a server, and it is safe to use with confidential material.

Frequently asked questions

Does Convert a Floating Point Number to Hex cost anything?

Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.

Is it safe to paste sensitive or confidential data?

No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.

How much text can I process at once?

There is no fixed limit. Because the work happens on your own device rather than on a shared server, the practical ceiling is your machine's memory, which comfortably handles inputs far larger than typical online tools allow.

Do I need to sign up or install anything?

Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.