Encode and decode Base64 strings
Base64 is a binary-to-text encoding that represents arbitrary bytes using a 64-character safe ASCII alphabet. It's how JWTs travel through URLs, how images get embedded in CSS data URIs, and how binary payloads fit into JSON fields. This tool roundtrips UTF-8 text correctly — naive implementations using only btoa/atob break on emoji and non-Latin scripts because those APIs assume Latin-1.
Base64 encodes arbitrary binary data as a string of 64 safe ASCII characters (A–Z, a–z, 0–9, +, /, =). It's used everywhere binary data must travel through text-only transports (email, JSON, URLs).
No. It's reversible by anyone in one step. Never use Base64 to 'hide' secrets.
The input likely wasn't UTF-8 encoded text to begin with. Base64 itself is just a bytes-to-text codec; what those bytes *mean* is a separate question.
This tool accepts text input only. For files, use our Hash Generator (which supports files), or open the dev console and run btoa on the ArrayBuffer.
A variant that replaces +/ with -_ and drops padding. Standard Base64 contains characters that need URL-encoding; URL-safe Base64 avoids that round trip.