Base64 Encode and Decode

Encode and decode Base64 / Base64URL with correct UTF-8 handling.

WebRuns in your browser

About this tool

Base64 turns arbitrary bytes into plain ASCII text, so binary data can travel through JSON, email, data URLs or HTTP headers. Text is encoded as UTF-8 first, so accented letters, emoji and non-Latin scripts round-trip correctly, which the browser's built-in btoa cannot do on its own.

The URL-safe variant (Base64URL) swaps + and / for - and _ and drops the = padding, which is the form used in JWTs and query strings. Decoding accepts either variant, ignores whitespace and tolerates missing padding.

Base64 is an encoding, not encryption: anyone can decode it, so never use it to hide passwords or secrets.

How to use it

  1. Paste text to encode, or a Base64 string to decode.
  2. Turn on URL-safe if the result goes into a URL or a JWT.
  3. Encode or decode, then copy the output.

Example

Input:

Hello, wörld

Base64:

SGVsbG8sIHfDtnJsZA==