Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text, Unicode-safe. Runs entirely in your browser — nothing is sent to any server.
What is Base64 encoding?
Base64 turns arbitrary binary or text data into a string made only of letters, digits, `+`, `/` and `=` padding — safe to embed in places that only expect plain ASCII text, like JSON payloads, URLs, email attachments or config files. This tool encodes and decodes Unicode-safely: it routes text through UTF-8 bytes first, so accented characters and emoji round-trip correctly instead of throwing or getting mangled, which is a common pitfall with the raw `btoa`/`atob` browser functions.
Examples
Encode or decode Base64 natively in most languages:
btoa(unescape(encodeURIComponent(str))) // encode
decodeURIComponent(escape(atob(b64))) // decodeimport base64
base64.b64encode(s.encode()).decode()
base64.b64decode(b64).decode()Base64.getEncoder().encodeToString(bytes)
Base64.getDecoder().decode(b64)Convert.ToBase64String(bytes)
Convert.FromBase64String(b64)import "encoding/base64"
base64.StdEncoding.EncodeToString(b)
base64.StdEncoding.DecodeString(s)base64_encode($str)
base64_decode($b64)require 'base64'
Base64.strict_encode64(str)
Base64.decode64(b64)Use Cases
Embedding binary data in JSON or XML
Those formats are text-only — Base64 lets you inline a small image, file, or binary blob as a plain string field.
Basic HTTP authentication headers
The `Authorization: Basic <token>` header is just `username:password` Base64-encoded — decode one here to see exactly what it contains.
Reading data: URIs
Inline images and fonts in CSS/HTML (`data:image/png;base64,...`) carry their payload Base64-encoded — decode the tail to inspect it.
Inspecting JWT segments
A JWT's header and payload are Base64URL, a close variant of Base64 — decoding one here shows the same underlying idea before reaching for a dedicated JWT decoder.