Developer ToolboxRFC 4648
New here? Take a 30-second tour of how this page works.

Base64 Encode / Decode

Decode or encode Base64. Text is treated as UTF-8, and errors give the position of the problem.

RFC 4648UTF-8 text · standard or URL-safe · limit 10 MB

Options
Decoded text

Runs in your browser. Nothing you enter is sent anywhere. How to check

1.How to use

  1. Choose Decode or Encode.
  2. Paste your text. The result appears as you type.
  3. Copy the result, or press Swap to move it into the input and reverse the mode.

Decoding accepts both alphabets, with or without = padding. Spaces and line breaks are ignored, so wrapped Base64 from email (MIME) or PEM files decodes as is. Adata:…;base64, prefix is removed and its media type is shown.

2.Examples

Encoding text with non-Latin characters

Hello, 世界 encodes to SGVsbG8sIOS4lueVjA==. The text is first turned into UTF-8 bytes, so each Chinese character takes three bytes.

Decoding a Basic authentication header

The value after Basic in Authorization: Basic YWxpY2U6ZXhhbXBsZS1wYXNzd29yZA==decodes to alice:example-password. Anyone who sees the header can read the password: Base64 hides nothing.

Standard and URL-safe output

Je?~ encodes to SmU/fg== with the standard alphabet and toSmU_fg with the URL-safe alphabet, which can go into a URL or file name without escaping.

3.Options explained

Standard or URL-safe alphabet

Standard Base64 uses + and / and pads the end with =(RFC 4648 §4). URL-safe Base64 uses - and _ instead and, as in JSON Web Tokens, leaves out the padding (RFC 4648 §5). Decoding detects the alphabet by itself.

Why UTF-8 matters

Base64 encodes bytes, not characters. This tool turns text into bytes with UTF-8, the encoding used by the web and most APIs. Decoded bytes that are not valid UTF-8 are shown as binary data with a hexadecimal preview and a Download button, instead of garbled text.

4.Limits

5.FAQ

Is Base64 encryption?

No. Base64 only changes how bytes are written. Anyone can decode it without a key, so never use it to protect passwords or secrets.

Why does my decoded text look garbled?

Either the data is not text (an image, a compressed file), or the text was encoded with a character set other than UTF-8. Binary data is detected and offered as a download.

What are the = signs at the end?

Padding. Base64 writes 3 bytes as 4 characters; when the input length is not a multiple of 3, one or two = fill the last group. Decoding works with or without them.

Is my data uploaded?

No. Encoding and decoding run in your browser. The privacy pageshows how to confirm this in your browser's Network tab.