# Bun Encode and decode base64 strings

> Encode and decode base64 strings

- Skill: `jarle/bun-encode-and-decode-base64-strings` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jarle/bun-encode-and-decode-base64-strings`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jarle/bun-encode-and-decode-base64-strings/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: jarle (https://skillmd.com/u/jarle)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/jarle/bun-encode-and-decode-base64-strings

---


# Encode and decode base64 strings

Bun implements the Web-standard [`atob`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/atob) and [`btoa`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/btoa) functions for encoding and decoding base64 strings.

```ts  theme={"theme":{"light":"github-light","dark":"dracula"}}
const data = "hello world";
const encoded = btoa(data); // => "aGVsbG8gd29ybGQ="
const decoded = atob(encoded); // => "hello world"
```

***

See [Docs > Web APIs](/runtime/web-apis) for a complete breakdown of the Web APIs implemented in Bun.

