Base64 Guide: Encode, Decode and File Conversion

Scenario 1: Encode and decode text

Open HeronTool's Base64 Encoder/Decoder:

  1. Paste text into the input box;
  2. Click encode to get the Base64 string;
  3. Paste Base64 back and click decode to restore the original.

Great for inspecting JWT Header/Payload, handling API parameters or debugging data.

Scenario 2: Image to Base64

Need to inline a small icon into web code? Use Image to Base64:

  1. Pick or drag in an image (ideally under a few hundred KB);
  2. Get a data:image/...;base64,... string automatically;
  3. Copy the full string into HTML/CSS/JSON.

The generated data URI works directly as an or CSS background-image.

Scenario 3: Restore a file from Base64

Got a string starting with data: or pure Base64 and want the original file? Use File ↔ Base64:

  1. Paste the Base64 string;
  2. Click decode;
  3. Download the restored file.

The file type is detected from the data URI's MIME header, or you can set the extension manually.

FAQ

Q: Does Base64 encrypt?
No. Base64 is reversible encoding — anyone with the string can decode it. For secrecy you must combine it with a real cipher (e.g., AES).

Q: Why is the output longer?
Base64 encodes every 3 bytes into 4 characters, adding ~33% — that's normal.

Q: Do +, / and = cause problems in URLs?
Yes. Use the Base64URL variant (-, _, no =) in URLs, or URL-encode standard Base64.

Q: What's the difference between a data URI and plain Base64?
A data URI carries a data:[MIME];base64, prefix with file-type info and works directly on web pages; plain Base64 is just the encoded characters.

In summary

Encode, decode, inline images, restore files — the daily Base64 quartet is free on HeronTool, processed locally, pasted and done, with no uploads.