The Advanced Base64 Encoder and Decoder handles both text strings and files directly in the browser. Encode a plain text value to Base64, decode a Base64 string back to readable text, or upload any file — image, PDF, archive, certificate — and get the Base64 output instantly. All processing happens locally in your browser. Nothing is sent to a server.
The File tab supports drag and drop, shows file name, size, and MIME type after encoding, and lets you decode Base64 back to a downloadable file. Enable the Data URI prefix option to produce output ready for use directly in HTML or CSS.
Drag & drop a file here, or
Any file type · max 5 MB
How to use
Encode text
- Select the Text tab.
- Paste or type the text you want to encode in the Input field.
- Click Encode.
- Copy the result from the Output field using the copy button.
Decode text
- Select the Text tab.
- Paste the Base64 string in the Input field.
- Click Decode.
- The original text appears in the Output field.
Encode a file
- Select the File tab.
- Drag and drop a file onto the drop zone, or click Browse file to select one. Maximum file size is 5 MB.
- The file is encoded immediately. File name, size, and MIME type are shown below the drop zone.
- To include the Data URI prefix (for use in HTML or CSS), enable the Include Data URI prefix checkbox before copying.
- Copy the Base64 output using the copy button.
Decode Base64 back to a file
- Select the File tab and scroll to the Decode file from Base64 section.
- Paste the Base64 string into the input field. If the string starts with
data:, the file type is detected automatically and the download starts immediately. - If the string is plain Base64 without a Data URI prefix, enter the file extension in the extension field (for example:
png,pdf,zip). Leave blank to download as.bin. - Click Download file.
Frequently asked questions
Frequently asked questions
No. All encoding and decoding happens entirely in your browser using JavaScript. No data is transmitted to any server. This applies to both text and file inputs.
The file size limit is 5 MB. This limit exists because Base64 encoding loads the entire file into browser memory before processing. Larger files can cause the browser tab to slow down or become unresponsive. For files larger than 5 MB, use the command line: base64 on Linux and macOS, or PowerShell’s [Convert]::ToBase64String() on Windows.
A Data URI is a format that embeds file content directly in HTML or CSS rather than referencing an external file. The format is data:<mime-type>;base64,<encoded-data>. Enable this option when you need output ready for use in an <img src="..."> attribute or a CSS background-image property.
If you are decoding text and the output contains garbled characters, the original text was likely encoded using a different character encoding (for example UTF-16 instead of UTF-8). This tool decodes using UTF-8, which is the standard for web and API use. If you are decoding a file and the result is corrupt, ensure you downloaded it using the correct file extension so your operating system opens it with the right application.
Any file type — images, PDFs, ZIP archives, certificates, scripts, executables, or any other binary or text file. The encoder reads the raw bytes regardless of file type. The MIME type is detected automatically from the file and shown in the file info row after encoding.
No. Base64 is a reversible encoding that anyone can decode without a key or password. It exists to make binary data safe for text-based systems, not to protect data. If you need to protect sensitive content, use encryption. Base64 provides no security on its own.
Practical examples
Embed a small icon in CSS without an extra HTTP request
Upload the icon PNG on the File tab, enable the Data URI prefix, copy the output, and paste it directly into your CSS:
.icon-check {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...");
width: 16px;
height: 16px;
}
Encode a secret value for a Kubernetes manifest
Kubernetes stores secret values as Base64 in YAML. Use the Text tab to encode the raw value, then paste the output into your manifest:
apiVersion: v1
kind: Secret
metadata:
name: db-credentials
type: Opaque
data:
password: cGFzc3dvcmQxMjM=
Decode a Base64 certificate received from a vendor
Vendors sometimes deliver certificates or configuration files as a Base64 string. Paste the string into the Decode section on the File tab, enter cer or pfx as the extension, and click Download. The file is ready to import into your certificate store.
Check what a Kubernetes secret contains
Retrieve the Base64 value from a Kubernetes secret and paste it into the Text tab to decode it:
kubectl get secret db-credentials -o jsonpath='{.data.password}'
Paste the output into the Input field on the Text tab and click Decode to read the original value.
Useful links
- RFC 4648 — The Base16, Base32, and Base64 Data Encodings
- Data URLs — MDN Web Docs
- Kubernetes Secrets — official documentation