0 characters
Base64 decoder, encoder and image to Base64
Paste Base64 to decode it, type text to encode it, or drop an image to get its Base64 and data URI. Everything happens in your browser.
How it works
Choose a mode
Decode turns Base64 back into text or a file, Encode turns text into Base64, and File to Base64 encodes any file or image.
Paste, type or drop
Paste Base64 or a data: URI, type text, drop a file or load one from a URL. The result updates as you type.
Copy or download
Copy the result, save it as .txt, or download the decoded bytes as a file.
Features
Base64 decode with clear errors
Invalid characters, wrong padding and truncated input are reported with line and column. Line breaks and missing padding are accepted, as in MIME and PEM.
UTF-8 text
Text is encoded as UTF-8, so accents and emoji survive the round trip. Bytes that are not valid UTF-8 are shown as binary data, not garbled text.
URL-safe base64url
Encode with - and _ instead of + and / and without = padding (RFC 4648 §5), as used in JWTs and URLs. Decoding detects both alphabets automatically.
Image to Base64
Drop a PNG, JPG, GIF, WebP, SVG or ICO file and get plain Base64, a data URI, an HTML img tag or a CSS background-image rule, with a preview of the image.
Base64 to file
Decoded data is checked for common file signatures (PNG, JPEG, PDF, ZIP and more). Images are previewed, and Download file saves the bytes with a matching extension.
Limits & privacy
Files can be up to 10 MB (their Base64 is about a third larger). Typed or pasted text can be up to 20 MB; above 1 MB the editor becomes a plain text area.
Encoding and decoding run on your device; SVG previews are shown as pictures, so scripts in them never run. Nothing is uploaded; Open from URL downloads the file directly into your browser. See the privacy page.
FAQ
How do I decode a Base64 string?
Choose Decode and paste the string. The decoded text appears on the right; if the data is binary, for example an image, use Download file to save it.
How do I convert an image to Base64?
Choose File to Base64 and drop the image. Pick Data URI, Base64 only, HTML img or CSS background and copy the result into your HTML, CSS or JSON.
What is the difference between Base64 and base64url?
base64url replaces + with - and / with _ and usually drops the = padding, so the text is safe in URLs and file names. Turn on URL-safe to produce it; decoding accepts both.
Why does my decoded text look broken?
The original data was probably not UTF-8 text, for example an image, a compressed file or text in another encoding. The tool then shows it as binary data so you can download it.
Can I decode a data: URI?
Yes. Paste the whole data:image/png;base64,… string; the prefix is recognized and the media type is used for the preview and the file extension.
Is Base64 encryption?
No. Base64 is only an encoding: anyone can decode it. Do not use it to protect passwords or secrets.