Base64 Converter
Encode text and files to Base64, or decode back to original format.
How to Use
- 1
Choose Mode
Select Encode or Decode.
- 2
Input Data
Type text, paste content, or upload a file.
- 3
Get Result
Copy or download the result.
Base64 Encoding Explained
This Base64 converter turns text or files into Base64 strings and decodes Base64 back into readable text, entirely in your browser.
How Base64 works
Base64, defined in RFC 4648, splits data into 6-bit groups and maps each group to one of 64 characters: A–Z, a–z, 0–9, + and /. The = sign pads the result to a multiple of four characters. Every 3 bytes of input become 4 characters, so encoded data is about 33% larger than the original.
What this tool handles
- UTF-8 text, including accented letters and emoji, which the browser's plain
btoa()rejects. - Any file in Encode mode, returned as raw Base64 without the
data:URI prefix. - Image preview in Decode mode for PNG, JPEG, GIF, WebP and SVG strings, or a full
data:imageURI. - Line breaks and spaces inside Base64 input, which are ignored when decoding.
Common uses and caveats
Developers use Base64 to embed small images in HTML or CSS as data URIs, carry binary attachments in email and JSON APIs, and store keys or certificates in text-based configuration. Keep these limits in mind:
- Inlining large images adds roughly a third to their size, and the browser cannot cache them separately from the page or stylesheet that contains them.
- Base64URL, the URL-safe variant used in JWTs, swaps
+and/for-and_. This tool expects the standard alphabet, so replace those characters before decoding. - Decoded output is shown as UTF-8 text. Base64 of a binary file other than a previewable image reports an error instead of producing a downloadable file.