# IEEE 754 API
> Inspect and build IEEE 754 floating-point numbers — see exactly how a number is stored in the bits. The encode endpoint takes a number and decomposes its single (32-bit) or double (64-bit) representation into the sign bit, the raw and unbiased exponent, the mantissa, the full binary layout split into sign / exponent / mantissa, the hexadecimal word, and a classification (normal, subnormal, zero, infinity or NaN); for single precision it also returns the actual value after rounding, so you can see floating-point error directly. The decode endpoint goes the other way — give it a hex word or a 32-/64-bit binary string and it returns the number it represents along with the same field breakdown. It accepts inf, -inf and nan, and lays bytes out big-endian. Everything is computed locally and deterministically, so it is instant and exact. Ideal for systems and embedded programming, teaching how floats work, debugging precision and rounding bugs, binary protocols and file formats, and interview prep. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This inspects floating-point bits; for integer base conversion use a base-convert API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/ieee754-api/..."
```

## Pricing
- **Free** (Free) — 4,935 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 14,450 calls/Mo, 8 req/s
- **Pro** ($26/Mo) — 195,500 calls/Mo, 20 req/s
- **Mega** ($64/Mo) — 1,020,000 calls/Mo, 50 req/s

## Endpoints

### IEEE 754

#### `GET /v1/decode` — IEEE 754 bits to number

**Parameters:**
- `hex` (query, optional, string) — The hex word (8 or 16 digits) Example: `40490fdb`
- `bits` (query, optional, string) — A 32- or 64-bit binary string
- `precision` (query, optional, string) — single or double (auto-detected) Example: `single`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ieee754-api/v1/decode?hex=40490fdb&precision=single"
```

**Response:**
```json
{
    "data": {
        "hex": "0x40490fdb",
        "bias": 127,
        "bits": 32,
        "sign": 0,
        "value": 3.1415927410125732,
        "binary": {
            "sign": "0",
            "exponent": "10000000",
            "mantissa": "10010010000111111011011"
        },
        "exponent": 1,
        "precision": "single",
        "exponent_raw": 128,
        "mantissa_hex": "0x490fdb",
        "sign_meaning": "positive",
        "classification": "normal"
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:19.219Z",
        "request_id": "ea7fb585-3fbb-4802-9837-9283fe7a926c"
    },
    "status": "ok",
    "message": "IEEE 754 bits to number",
    "success": true
}
```

#### `GET /v1/encode` — Number to IEEE 754 bits

**Parameters:**
- `value` (query, required, string) — The number (or inf, -inf, nan) Example: `3.141592653589793`
- `precision` (query, optional, string) — double (default, 64-bit) or single (32-bit) Example: `double`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ieee754-api/v1/encode?value=3.141592653589793&precision=double"
```

**Response:**
```json
{
    "data": {
        "hex": "0x400921fb54442d18",
        "bias": 1023,
        "bits": 64,
        "sign": 0,
        "value": 3.141592653589793,
        "binary": {
            "sign": "0",
            "exponent": "10000000000",
            "mantissa": "1001001000011111101101010100010001000010110100011000"
        },
        "exponent": 1,
        "precision": "double",
        "exponent_raw": 1024,
        "mantissa_hex": "0x921fb54442d18",
        "sign_meaning": "positive",
        "classification": "normal"
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:19.328Z",
        "request_id": "6a92912f-d8f9-432c-8f58-7e459251f208"
    },
    "status": "ok",
    "message": "Number to IEEE 754 bits",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ieee754-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "name": "IEEE 754 API",
        "notes": "Double has an 11-bit exponent (bias 1023) and 52-bit mantissa; single has 8-bit exponent (bias 127) and 23-bit mantissa. Encoding to single rounds the value. Bytes are laid out big-endian (most significant first). This inspects float bits — for integer base conversion use a base-convert API. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/encode",
                "params": {
                    "value": "the number (or inf, -inf, nan)",
                    "precision": "double (default, 64-bit) or single (32-bit)"
                },
                "returns": "the sign, exponent, mantissa, hex and binary layout"
            },
            {
                "path": "/v1/decode",
                "params": {
                    "hex": "the hex word (8 or 16 digits)",
                    "bits": "alternatively a 32- or 64-bit binary string",
                    "precision": "single or double (auto-detected from length)"
                },
                "returns": "the number and its IEEE 754 fields"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Inspect and build IEEE 754 floating-point numbers. The encode endpoint takes a number and shows exactly how it is stored in single (32-bit) or double (64-bit) precision
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/ieee754-api
OpenAPI spec: https://www.oanor.com/api/ieee754-api/openapi.json
