Base64 Encoder/Decoder & File Viewer
Encode and decode Base64 online, and preview Base64 as an image or PDF right in your browser. Turn any file into Base64, with UTF-8 and URL-safe support. Free.
Encode, decode and view Base64 files
Base64 represents any data using only 64 safe characters: letters, digits, + and /. It lets binary data or special characters pass through systems built for plain text, such as email, JSON fields, HTTP headers and data URLs. This tool converts text to Base64 and back, and treats your text as UTF-8, so Hindi, emoji and other non-English characters work correctly. Paste Base64 for an image or PDF into the Decode & View tab, with or without a data: prefix, and the file appears in a live preview that you can download. You can also turn any file into Base64.
Encoding makes data about one third larger, because every 3 bytes become 4 characters. The = signs you see at the end are padding that brings the length to a multiple of 4.
Examples
Some strings and their encoded forms. HTTP Basic authentication, shown last, sends user:password encoded this way.
Hello SGVsbG8=
Hello, नमस्ते! 🌍 SGVsbG8sIOCkqOCkruCkuOCljeCkpOClhyEg8J+MjQ==
admin:secret YWRtaW46c2VjcmV0
Authorization: Basic YWRtaW46c2VjcmV0Standard and URL-safe Base64
The +, / and = characters have special meanings in URLs, so a second alphabet exists for those cases. Turn on URL-safe output to use - and _ and drop the padding. JWTs use this form. The decoder accepts both forms, so you do not need to convert first.
Base64 is not encryption
Anyone can decode Base64 in seconds, as this page shows, because it uses no key. Never treat it as protection for passwords or personal data. A Kubernetes Secret, for instance, is only Base64-encoded by default, so its values are readable by anyone with access to the object. Use real encryption when something needs to stay confidential, and always send Basic authentication over HTTPS. Anything encoded this way should be treated as if it were plain text, including values you see in logs and browser history.
Typical uses
- Embedding a small image or font in CSS or HTML with a
data:URL. - Reading or writing Kubernetes Secret values.
- Debugging email attachments, webhook signatures and tokens.
- Carrying binary data inside a JSON field, which cannot hold raw bytes.
Frequently Asked Questions
How do I convert Base64 to an image or PDF?
Paste the Base64 into the Decode & View tab. The tool reads the first bytes to identify PNG, JPEG, GIF, WebP, SVG and PDF files, then shows a preview and a download button.
Why do I get an error when decoding?
The data may be a binary format that this page does not recognise, or text in an encoding other than UTF-8.
Why does my Base64 end with one or two equals signs?
That is padding. The input length was not a multiple of 3 bytes, so = fills the final group. Many decoders, including this one, also accept it without padding.
How much bigger does Base64 make my data?
About 33 percent, plus any line breaks. Bear that in mind before embedding large files in JSON or CSS.
Is the text I enter uploaded?
No. Encoding and decoding are done by JavaScript in your browser.