Skip to content

Base64 Encode/Decode

Base64 Encode/Decode

Base64 Encode/Decode supports text and image workflows. Encode or decode UTF-8 text, or upload images to generate Data URLs or raw Base64 with local preview and download.

Base64 Encode/Decode

Quick Start

1
Enter text (plain or a Base64 string) into the field
2
Click “Encode” or “Decode” to process
3
Input and result share the same field; copy or clear with one click
4
To verify, encode then switch to “Decode” for a round‑trip check
5
Choose Text mode for UTF-8 strings, or switch to Image mode for image files and image Data URLs
6
In Image mode, upload a file to generate a Data URL or raw Base64 result immediately
7
Paste a Data URL or raw Base64, choose MIME when needed, then reconstruct the preview

Common Scenarios

URL/JWT

Prefer the URL‑safe variant (−/_); the trailing '=' may be omitted to avoid escaping issues

Email/MIME

When wrapping is required, use MIME 76 columns (CRLF); for the web, don't wrap. This tool provides 76‑column wrapping and an LF/CRLF toggle

Multiline text

enable Per‑line encode to encode each line independently

MIME/PEM

enable 76‑column wrapping; enable LF line breaks when needed

Data URL

When embedding, generate data:[mime];base64,…; the decoder auto‑extracts the part after the comma

Round‑trip verify

encode then immediately decode to ensure fidelity

Image upload

Keep the original bytes and switch between Data URL and raw Base64 output without re-uploading

Image Data URL

Paste data:image/...;base64,... to auto-detect MIME and rebuild a previewable image

Raw Base64 image data

Supply the original image MIME explicitly before reconstructing or downloading

Extended workflow

encode base64, decode base64, and base64 converter can be handled in the same review flow, so you can verify results before copying or exporting.

Encoding Parameters & Variants

URL‑safe output
Encode per line (each line independently)
Wrap at MIME 76 columns (CRLF)
Use LF for line breaks (\n)
Data URL
Raw Base64
Raw Base64 image input needs an explicit MIME type because Base64 itself does not store file format metadata
Auto‑padding: length aligned to a multiple of 4; invalid lengths are reported
Whitespace‑tolerant: line breaks and spaces are removed on decode

Usage Advice

Use UTF‑8 consistently to avoid garbled characters
Default is URL‑safe; disable it for standard Base64
When exchanging across systems, strip line breaks/spaces; add only for display
Base64 increases size by ~33%; avoid for large files
Standard Base64 for legacy systems: disable URL‑safe (keep +/ and =)
Per‑line encode re‑encodes existing Base64; for variant conversion only, turn it off before encoding
76‑column wrapping affects display only; the decoder ignores breaks and whitespace
When sharing raw Base64, keep the original MIME type with it so the receiver can reconstruct the file correctly
Preview availability depends on browser image support; if preview fails, download still keeps the original bytes

Limitations & Compatibility

Very long text may affect performance; consider splitting
Binary data: the UI is text‑centric; for binaries use Data URLs or CLI tools
Max size is limited by browser memory
Some image formats may encode successfully but remain unpreviewable in the current browser

Privacy & Security

All processing happens locally in your browser. You can replace, clear, and re-run the current content at any time.
Security note: Base64 is encoding, not encryption. Encrypt sensitive data first, then encode

FAQ

6

Continue with these related tools for the next step.