Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 to text with live preview. Upload files and images via drag-and-drop. Supports URL-safe Base64, UTF-8, ASCII, and Latin-1 encodings.

Drag and drop a file here to encode it to Base64
0 B
0 B

Base64 Encoding Tips

Use URL-safe for URLs

Standard Base64 uses + and / which need percent-encoding in URLs. Toggle URL-safe mode to use - and _ instead.

Expect 33% size increase

Every 3 bytes of input become 4 Base64 characters. A 30KB image becomes ~40KB in Base64.

Embed images in CSS/HTML

Use "data:image/png;base64,..." data URIs to embed small images directly in HTML or CSS without extra HTTP requests.

Choose the right encoding

UTF-8 handles all Unicode characters. Use ASCII for 7-bit data or Latin-1 for Western European text with byte-level control.

API payloads

Base64 is commonly used to send binary data (images, PDFs) in JSON API payloads since JSON only supports text.

All processing is local

Your data never leaves your browser. Encoding and decoding happens entirely in JavaScript — no server involved.

Frequently Asked Questions

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data as an ASCII string. It uses 64 printable characters (A-Z, a-z, 0-9, +, /) to encode data, making it safe to transmit over text-based protocols like email or embed in JSON and XML.

What is URL-safe Base64?

URL-safe Base64 replaces the + and / characters with - and _ respectively, and removes trailing = padding. This makes the encoded string safe to use directly in URLs, filenames, and query parameters without percent-encoding.

Why is my Base64 output larger than the input?

Base64 encoding increases data size by approximately 33%. Every 3 bytes of input become 4 Base64 characters. This overhead is the trade-off for being able to safely represent binary data as text.

Can I encode images and files to Base64?

Yes. Drag and drop any file onto the drop zone or click “Upload File” to select a file. The file is read entirely in your browser and converted to its Base64 representation. You can also paste a Base64 string and download it as a file.

How does this tool handle different character encodings?

Use the encoding selector to choose how text is converted to bytes before Base64 encoding. UTF-8 handles all Unicode characters including emojis and CJK. ASCII covers characters 0-127. Latin-1 (ISO 8859-1) covers 0-255 and is useful for Western European text.

How do I convert Base64 to an image?

Paste your Base64 string into the Base64 field and switch to Decode mode. If the data represents a valid image (PNG, JPEG, GIF, WebP, or SVG), a live preview appears automatically below the text panels. You can also click “Download as File” to save the decoded image to your device.

Is my data safe?

Yes. All processing happens entirely in your browser using JavaScript's built-in encoding APIs. No data is sent to any server.