Free Tool

Base64 Encoder & Decoder

Encode any file to a Base64 string or decode Base64 back to its original file. Free, no sign-up required.

Convert a File to Base64 and Decode Base64 to File

What is Base64?

Base64 encodes binary data as ASCII text using 64 printable characters. It's commonly used to embed images in HTML/CSS via data URLs, transmit binary data in JSON APIs, and encode email attachments.

When to encode vs decode

Encode when you need to represent binary or binary-like data as plain text for transmission or storage. Decode when you receive a Base64 string and need the original file or content back.

File size note

Base64 encoding increases the output size by approximately 33% compared to the original binary. Keep this in mind when embedding large files.

How to use

  1. Click "Choose File" and select any file from your device.
  2. Click "Upload File" to encode the file to a Base64 string.
  3. Copy the result with the "Copy" button, or paste a Base64 string and click "Decode" to recover the original file.

Examples

  • Simple: Encoding the text Hello, World! produces SGVsbG8sIFdvcmxkIQ==. Paste that string back and click "Decode" to recover the original text.
  • Developer workflow: Embed a small icon in CSS without an external request — encode the SVG file to Base64, then use it as a data:image/svg+xml;base64,... value in a background-image property.
  • Edge case: Base64 is encoding, not encryption. The output is easily decoded by anyone. Never use it to hide sensitive data — use proper encryption instead.

Encoding and decoding runs entirely in your browser — no files or data are uploaded to any server.

Frequently Asked Questions

What is Base64 encoding?
Base64 is an encoding scheme that converts binary data into ASCII text using 64 printable characters. It is commonly used to embed images in HTML/CSS, transmit binary data in JSON, and encode email attachments.
How do I encode a file to Base64?
Click "Choose File" to select your file, then click "Upload File". The Base64 string will appear in the textarea. Click "Copy" to copy it to your clipboard.
How do I decode Base64 back to a file?
Paste your Base64 string into the textarea and click "Decode". If the content is an image, a preview will be shown below.
Is this Base64 tool free?
Yes, the Base64 encoder and decoder is completely free with no sign-up or login required.