How to encode to Base64
Encode text or binary to Base64 so it survives text-only transports. Free online tool plus the one-liner in each language.
Encoding to Base64 turns bytes into safe ASCII text for transports that cannot carry raw binary — data URLs, JSON, headers, and email. Here is how to do it online and in code.
Online
Paste your text into our Base64 tool, choose encode, and copy the result. Remember Base64 is not encryption — it is reversible by anyone, so never use it to hide secrets.
In code
JavaScript: btoa(str) for ASCII, or Buffer.from(str).toString("base64") in Node. Python: base64.b64encode(data). PHP: base64_encode($data). Go: base64.StdEncoding.EncodeToString(b). Use the URL-safe variant when the output goes into a URL or JWT.
Step by step
Open the Base64 tool and paste your text.
Select "encode" to produce the Base64 string.
Copy the result into your data URL, header, or payload.
Use the URL-safe variant (- and _ instead of + and /) if it goes in a URL or JWT.
Try it now — free, no signup
Use the Base64 tool in your browser. Then, when you need it at scale with an API key and higher limits, grab the full Eveses API.