[Runtime
](../../../index.md)[Package Manager
](../../../pm/cli/install/index.md)[Bundler
](../../../bundler/index.md)[Test Runner
](../../../test/index.md)[Guides
](../../index.md)[Reference
](https://bun.com/reference)[Blog
](https://bun.com/blog)[Feedback
](../../../feedback/index.md)
Use Bun.deflateSync() to compress a Uint8Array with DEFLATE.
const data = Buffer.from("Hello, world!");
const compressed = Bun.deflateSync("Hello, world!");
// => Uint8Array
const decompressed = Bun.inflateSync(compressed);
// => Uint8Array
See Docs > API > Utils for more useful utilities.
Was this page helpful?
[
Compress and decompress data with gzip
Previous
](../gzip/index.md)[
Escape an HTML string
Next
](../escape-html/index.md)