Base64 decode and encode
Paste Base64 to decode it, or type text to encode it. The direction follows what you paste; the gray text is an example.
Text → Base64
This looks like a JWT. The JWT decoder reads its header and payload.
Base64 Example
SGVsbG8sIHdvcmxkIQ==
Options
Good to know
- Which way
- Base64 that decodes to readable text, or to an image, PDF or ZIP, is decoded. Anything else is encoded, including short words made of Base64 letters, such as
testorfile. If the guess is wrong, use Decode instead or Encode instead. - URL-safe
- Base64url (RFC 4648, section 5) uses
-and_in place of+and/, and often leaves out the=padding. JWTs use it. Both kinds decode here, with or without padding. - Line breaks
- Email (MIME) Base64 has a line break at least every 76 characters. Line breaks and spaces are ignored when decoding. An email attachment pasted with its headers (
Content-Type: …, a blank line, then the Base64) decodes too, and Download keeps its file name. - Files and images
- Open or drop a file up to 5 MB to encode it. A data URL such as
data:image/png;base64,iVBOR…, or Base64 of an image, decodes to the image with a preview; Download saves it. - Size
- Every 3 bytes become 4 characters, so Base64 is about a third larger than the original.
- Not encryption
- Anyone can decode Base64. It makes bytes safe to send as text; it does not hide them.
- In code
- Shell
base64 fileandbase64 -d. Pythonbase64.b64encode(data). JavaScriptbtoaandatobwork on single bytes only, so encode text to UTF-8 first withTextEncoder. - Open from a link
?decode=SGVsbG8=or?encode=Helloopens the page with the answer;?input=detects the direction. A+in a link turns into a space, so write it as%2B; spaces indecodeare read back as+.