Base64 Encoder / Decoder
Encode or decode Base64 with full UTF-8 and URL-safe variants.
Base64 encoder and decoder with full UTF-8 support
Base64 is the standard way to encode binary or non-ASCII text into a 64-character ASCII alphabet so it can travel through systems that only handle text — HTTP headers, JSON strings, data URIs, JWT segments. This tool encodes and decodes Base64 with proper UTF-8 handling and an optional URL-safe variant for tokens, query parameters, and JWT.
Standard vs URL-safe
Standard Base64 uses +, /, and
= padding — three characters that have special meaning in
URLs. The URL-safe variant (RFC 4648 §5) replaces + with
-, / with _, and drops the
padding. JWTs and many modern APIs use URL-safe Base64 — toggle the
option here if your input doesn't decode as standard.
UTF-8 done right
The naive btoa(input) call fails on any non-ASCII
character ("InvalidCharacterError"). This tool encodes via
btoa(unescape(encodeURIComponent(s))) and decodes via
decodeURIComponent(escape(atob(s))), which round-trips
emoji, CJK characters, and accented Latin correctly. So
カフェ encodes to 44Kr44OV44Kn and back,
exactly like in your backend.
Common use cases
- Inspect a JWT segment — copy the payload chunk and decode (or use our JWT Decoder).
- Build a data URI — encode an SVG or small PNG to embed inline in CSS or HTML.
-
Read an HTTP Basic Authorization header — decode
dXNlcjpwYXNztouser:pass. - Round-trip a config secret through Kubernetes Secrets, which expects values Base64-encoded.
Privacy
All encoding happens in your browser via the built-in
btoa/atob functions. The tool never sends
your input to a server.