Base64 Encoder and Decoder

Encode UTF-8 text as standard Base64 or Base64URL, or decode a Base64 string back to text. Choose the alphabet your API expects. Everything runs in your browser and your input stays on this device.

What this tool does

Convert UTF-8 text to standard Base64 or Base64URL and recover UTF-8 text from the encoded form.

Base64 vs. Base64URL: which should I use?

Standard Base64 uses plus and slash. Base64URL uses hyphen and underscore instead, so it is safe to place in URLs. Choose the alphabet specified by the API or format you are working with.

When to use it

Check a text transport fixture when a service disagrees on alphabet, padding or Unicode encoding.

How to use it

  1. Choose Encode for plain text or Decode for an encoded string.
  2. Select Standard Base64 or Base64URL according to the receiving format.
  3. Run Convert Base64 and check the result before passing it to another system.

A JWT’s header and payload are Base64URL text. To read one, use the JWT Decoder.

Worked example

Enter café in Encode mode and choose the standard alphabet. The output is Y2Fmw6k=. Switch to Decode, paste that output and run the converter again to recover café. The accent is represented by multiple UTF-8 bytes before Base64 encoding, which is why using an ASCII-only workflow can give a different result. Try the same round trip in Base64URL mode when preparing a test value for a URL-safe interface. For a readable multiline sample, compare the displayed text with the original and check whether the source document included a final newline.

Example input
café
Example output
Y2Fmw6k=

Supported features and limitations

The decoder displays UTF-8 text. Base64 encodes data and provides no confidentiality. Binary payloads require a separate file workflow.

Common mistakes and edge cases

Base64URL uses hyphen and underscore in place of plus and slash. Choose the alphabet specified by your API. Standard Base64 copied from a MIME message may be wrapped across several lines, and the decoder accepts whitespace in that input. Surrounding quotes or a data URL prefix have a different purpose and should be removed before pasting. Preserve the source text’s spaces and line endings when byte-for-byte equality matters. When troubleshooting a mismatch with another encoder, compare a tiny sample first. Check its UTF-8 bytes against the expected input and look for an invisible trailing newline. Choose alphabet and padding according to the receiving interface.

Frequently asked questions

Can I use Base64 to protect a secret?
Base64 is a reversible representation. Anyone with the string can decode it with the right alphabet. Use your application’s normal secret storage and encryption mechanisms for confidential values.
Can I decode an image with this tool?
The decoder expects the resulting bytes to be UTF-8 text. Use a file-oriented decoder for image, archive or other binary data. If a source claims to contain text and decoding fails, check which character encoding the sender used.
What is the difference between Base64 and Base64URL?
They use different characters for the last two symbols: plus and slash in standard Base64, hyphen and underscore in Base64URL. Use the one your API specifies.
Does it handle accented characters?
Yes. Text is encoded as UTF-8 first, so café encodes to Y2Fmw6k= in standard Base64.
Can it decode Base64 wrapped across several lines?
Yes. The decoder accepts spaces, tabs and line breaks, which covers the wrapped Base64 found in email messages.
Is my text uploaded anywhere?
No. It is processed in your browser and stays on your device.

Related tools

Developer guides