A Base64 encoder/decoder is a free online tool that converts text into Base64 (a safe ASCII representation used in emails, data URIs, and APIs) and converts Base64 back into readable text. A second tab converts any file on your device into a Base64 data URI, all without uploading anything.
How do I encode text to Base64 online?
Stay on the Text tab, type or paste your text, and press Encode. The Base64 output appears instantly and handles unicode characters like emoji correctly. Press Copy output to use it in your code, email, or API request.
Base64 represents binary data using only 64 safe ASCII characters (A-Z, a-z, 0-9, + and /), with = used for padding. It is used in data URIs, JSON Web Tokens, email attachments, and anywhere binary data must travel through a text-only channel. The output is about 33% larger than the original.
How can I convert a file to a Base64 data URI?
Open the File to Base64 tab, choose any file from your device, and the tool reads it locally and shows a complete data URI such as data:image/png;base64,.... Copy it into an img src or a CSS background, or download it as a text file.
Data URIs let you embed small files directly in HTML or CSS, which removes extra HTTP requests. They work best for small assets: large images are better kept as separate files because Base64 inflates their size by a third and blocks caching.
Frequently asked questions
Is this Base64 tool free and unlimited?
Yes. Encode and decode as much text and as many files as you like. No account, no limits, and everything runs in your browser.
Why does decoding fail with an invalid character error?
Base64 only allows A-Z, a-z, 0-9, +, /, and = padding. Extra characters (for example line breaks copied from an email, or a URL-safe variant using - and _) will trigger the error. Remove them or convert URL-safe Base64 first.
Does Base64 encoding encrypt my data?
No. Base64 is an encoding, not encryption: anyone can decode it instantly. Never use it to hide passwords, tokens, or secrets.
Are my files uploaded anywhere?
No. The File tab uses the browser FileReader API to read the file on your own device. Nothing is sent to any server.
What is the difference between Base64 and URL-safe Base64?
Standard Base64 uses + and /, which have special meaning in URLs. URL-safe Base64 replaces them with - and _, and usually drops the = padding. JWTs use the URL-safe variant.