Base64 Encoder & Decoder

Convert text to Base64 or decode a Base64 string back to readable text. Text is handled as UTF-8, so accented letters, emoji and non-Latin scripts work correctly.

Base64 Encoder & DecoderRuns in your browser

Your input stays in your browser and is not sent to a server by this page.

What it is and when to use it

Base64 represents data using only 64 safe text characters. You see it in data URIs, email attachments, HTTP Basic authentication headers and the segments of a JWT. Use this tool to encode text for those places, or to decode a Base64 string you received and see what it contains.

How to use

  1. Enter text in the input box.
  2. Select Encode to produce Base64, or Decode to read Base64.
  3. Tick URL-safe if the result is used in a URL or token.
  4. Copy the result.

Example

Input
Hello, 你好
Result
SGVsbG8sIOS9oOWlvQ==

Tips and common mistakes

Frequently asked questions

Is Base64 encryption?

No. Base64 is only an encoding. Anyone can decode it, so never use it to protect secrets.

Why does decoding sometimes fail?

The input may contain characters outside the Base64 alphabet, have an impossible length, or decode to bytes that are not UTF-8 text (for example, an image).

Does it accept data URLs?

Yes. A leading data:...;base64, prefix is removed before decoding. Only text results are shown.

Related tools