[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)
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.
Was this page helpful?
[
Generate a UUID
Previous
](../javascript-uuid/index.md)[
Compress and decompress data with gzip
Next
](../gzip/index.md)