---
title: "lz4compress"
description: "Compresses bytes into a raw LZ4 block."
---

```lua
lz4compress(data: string): string
```

---

## Aliases

- `crypt.lz4compress`
- `crypt.base64.lz4compress`

---

## Arguments

<ParamField body="data" type="string" required>
  The input bytes as a binary-safe Luau string.
</ParamField>

---

## Returns

<ResponseField name="result" type="string">
  The string value returned by this operation.
</ResponseField>

Binary output without an LZ4 frame header or an uncompressed-size prefix. Pair with lz4decompress; this is not an external .lz4 frame/file format.

---

## Example

```lua
local compressed = lz4compress("hello hello hello")
print(lz4decompress(compressed))
```
