DevToolHere

How to Encode and Decode Base64

Base64 encoding converts binary data into ASCII characters, which makes it safe to embed in JSON, XML, HTML, or email bodies. Whether you need to encode an API key for a header or decode a data URI, this guide shows you how in seconds.

Try Base64 Encode/Decode Now

Free, no signup. Works in your browser.

Open Tool
1

Open the Base64 tool

Launch the Base64 Encode / Decode tool from the Encoding category. You will see two panels — input on the left and output on the right.

2

Choose Encode or Decode mode

Toggle between Encode and Decode at the top of the tool. Encode mode converts plain text to Base64; Decode mode converts Base64 back to readable text.

3

Enter your data

Type or paste the string you want to convert in the input panel. For file encoding, drag and drop the file directly into the input area to read its binary content.

4

Review the output

The result appears instantly in the output panel. For encoded output, you will see a string of letters, digits, plus signs, and slashes. For decoded output, the original text is restored.

5

Copy the result

Click the copy button or use Ctrl+A / Cmd+A to select all text and copy it to your clipboard. You can also download the result as a text file.

Pro Tips

  • *Base64 increases data size by roughly 33% — avoid encoding large files unless necessary.
  • *Use Base64 to embed small images as data URIs in CSS: `background-image: url(data:image/png;base64,...)`.
  • *Never use Base64 as encryption — it is an encoding, not a security mechanism.
  • *When decoding JWT tokens, the payload is Base64url-encoded (uses - and _ instead of + and /).

Related Guides

Explore all 110+ tools