Base64 Encoder and Decoder
Encode text to Base64, or decode Base64 to text. Supports the URL-safe alphabet.
🔒 Client · OfflineDrop a file here, or click to choose a file.
Max size 2 MB. The tool makes the data URL on your device. It does not upload the file.
About Base64
Base64 writes binary data with 64 safe characters: A to Z, a to z, 0 to 9, plus, and slash. Every 3 bytes become 4 characters, so the output is about 33 percent larger than the input. The equals sign pads the end to a multiple of 4 characters.
Use standard Base64 for a data URL, an email attachment, or a basic authentication header. Use Base64 URL for a JWT, a query value, or a file name. Base64 URL replaces plus with minus and slash with underscore, and it drops the padding. Change the format in the Format list to switch between the two.
Paste text, then select Encode or Decode. Select Swap to send the result back to the input. The tool reads and writes UTF-8, so an emoji or an accented letter encodes correctly. If the input has a character that Base64 does not hold, the tool names the character and its exact offset. Every operation runs in your browser.
The tool also reads a file. Drop a file, or click the drop area to choose one. The tool writes a data URL in the form data:image/png;base64,..., and it takes the MIME type from the file. Use a data URL to put a small image in CSS or in HTML without a second request. The limit is 2 MB, because a data URL is about 33 percent larger than the file.
To go back to a file, paste the data URL, select Decode, then select Download file. The tool keeps the bytes binary, and it reads the MIME type to name the file. It does not decode a file as text.
Base64 is not encryption. Anyone can decode the value. Use it to move bytes through a text channel, not to hide data.