How to use Base64 Encoder/Decoder

  1. Under Base64 Options, choose Base64 Encode or Base64 Decode.
  2. Type or paste your text into the Input Data box, or click Select files to load a text file.
  3. Read the converted text in the Result box. It updates as you type or switch modes. If you delete all the input, the last result stays in the box.
  4. Click Copy to clipboard to copy the result, or Download to save it as a .txt file.

Examples

Encode text

Base64 Encode: "Hello, World!" -> "SGVsbG8sIFdvcmxkIQ=="

Encode accented text as UTF-8

Base64 Encode: "café" -> "Y2Fmw6k=" (the é is encoded as its two UTF-8 bytes).

Decode URL-safe Base64 without padding

Base64 Decode: "aGk-Pz8_" -> "hi>???". The same text in standard Base64 is "aGk+Pz8/".

Good to know

  • Encoding treats the input as UTF-8 and outputs standard Base64 (A-Z, a-z, 0-9, + and /) with = padding.
  • When decoding, characters outside the Base64 alphabet, such as spaces and line breaks, are skipped. The URL-safe characters - and _ are accepted, trailing = padding is optional, and decoding stops at the first =.
  • Decoded bytes are shown as UTF-8 text, and bytes that are not valid UTF-8 become the replacement character (U+FFFD). The tool is meant for text, not binary files such as images.
  • Conversion runs in your browser using the buffer library. Neither the tool code nor that library makes network requests, so your text is not sent to a server.

Frequently asked questions

Can it decode URL-safe Base64?

Yes. When decoding, - and _ are read as + and /, and missing = padding is accepted. Encoding always outputs standard Base64 with + and / and = padding.

Can I encode an image or another binary file?

No. Select files reads the file as text, and decoded output is shown as UTF-8 text, so binary data is not preserved. Use this tool for text.

What happens if the Base64 input is invalid?

You get no error message. Characters outside the Base64 alphabet are skipped and decoding stops at the first =, so badly formed input produces garbled or empty text instead of an error. If the result looks wrong, check the input.

More Text Tools