Files
bun.sh/docs/guides/util/base64.md
2025-07-10 00:10:43 -07:00

587 B

name
name
Encode and decode base64 strings

Bun implements the Web-standard atob and btoa functions for encoding and decoding base64 strings.

const data = "hello world";
const encoded = btoa(data); // => "aGVsbG8gd29ybGQ="
const decoded = atob(encoded); // => "hello world"

See Docs > Web APIs for a complete breakdown of the Web APIs implemented in Bun.