Home · Tools · Base64 Encoder / Decoder

Base64 Encoder / Decoder

Encode or decode Base64 with full UTF-8 and URL-safe variants.

Input
Output

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

Privacy

All encoding happens in your browser via the built-in btoa/atob functions. The tool never sends your input to a server.

Related tools

FAQ

Why does my Base64 fail to decode?
Common causes: missing padding (we add it automatically), URL-safe characters (toggle the URL-safe option), or stray whitespace pasted from email. Strip whitespace and try again.
Is Base64 encryption?
No. Base64 is encoding, not encryption — anyone can decode it. Never use Base64 to 'hide' a secret.
Will it handle emoji and non-ASCII characters?
Yes. Encoding wraps btoa with proper UTF-8 conversion, so every Unicode character round-trips correctly.
What's the difference between standard and URL-safe Base64?
URL-safe replaces + with - and / with _, and drops = padding. JWTs and many tokens use URL-safe.