# To MessagePack

Converts JSON to MessagePack encoded byte buffer. MessagePack is a computer data interchange format. It is a binary form for representing simple data structures like arrays and associative arrays. To MessagePack lives in the **Data format** category of the `fx` menu. See [MessagePack](https://msgpack.org/) for format details.

## Parameter

| Parameter | Type   | Required | Default | Description                                            |
| --------- | ------ | -------- | ------- | ------------------------------------------------------ |
| Input     | string | yes      | —       | Value to transform. Previous step output or a literal. |

`Input` is the primary value (previous step output or a literal).

## Returned value

| Type     | Description                                  |
| -------- | -------------------------------------------- |
| `string` | Result of the To MessagePack transformation. |

## Limitations

- Invalid or mismatched encoding for the chosen options typically raises an evaluation error — fix the Input or options before re-running.

## Example

<details>
<summary>Encode JSON as MessagePack</summary>

Convert a JSON document into MessagePack binary (shown as encoded bytes in Studio).

1. Set **Input** to a JSON object or array. Paste:

   ```text title="Input"
   {"ok":true}
   ```

2. Confirm **Output value** is the MessagePack-encoded byte representation.

</details>
