Guide: encode and decode Base64 in the browser
Base64 encodes binary as ASCII text — common in Data URLs (`data:image/png;base64,…`), Basic Auth headers, and JSON-embedded blobs. Manual decoding often breaks on padding or charset.
Conversion runs fully client-side: short strings and small files never reach WebDevTools servers. File mode helps build Data URLs for prototypes without CDN uploads.
Use when debugging malformed tokens, inspecting API attachments, or HTML email placeholders. Remember Base64 adds ~33% size — it is not a production binary transport.
Step by step
- Choose text or file — Paste UTF-8 for strings or pick a file to encode binaries (images, small PDFs).
- Pick encode or decode — Encode turns bytes into Base64; decode restores the original. Padding errors surface on decode.
- Check charset and URL-safe — Some APIs need URL-safe Base64 (`-` and `_`). Toggle when the string comes from JWTs or query params.
- Copy the output — Use in inline image `src`, `Authorization` headers, or fixtures — never commit real secrets.