# Compress and decompress data with DEFLATE

> Compress a `Uint8Array` with `Bun.deflateSync()` and decompress it with `Bun.inflateSync()`.

Use `Bun.deflateSync()` to compress a `Uint8Array` with DEFLATE.

```ts
const data = Buffer.from("Hello, world!");
const compressed = Bun.deflateSync(data);
// => Uint8Array

const decompressed = Bun.inflateSync(compressed);
// => Uint8Array
```

---

See [Utils](https://bun.aphrody.app/docs/runtime/utils).
