Skip to content

Base64 Encode/Decode

Base64 Encode/Decode supports text and image workflows. Encode or decode text, convert images to Data URLs or raw Base64, or turn Data URLs / Base64 back into images for local preview and download.

Input Text

Character

0 / 500,000

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
Use "Text mode" for plain text, "Image to Base64" for uploading and encoding images, and "Base64 to Image" for turning Data URLs or Base64 back into images.
6
Upload an image in the "Image to Base64" tab to generate a Data URL or raw Base64 right away.
7
In the "Base64 to Image" tab, paste a Data URL, or paste raw Base64 and choose a MIME type. The image preview updates automatically.

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 detect the MIME type automatically and preview the image immediately.

Raw Base64 image data

provide the original image MIME type so the tool can preview it automatically and download it as an image.

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

Text mode uses UTF-8 by default. If you need GBK, Shift-JIS, or another encoding, convert it first before using this tool.
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.