Base64 Encoder
Encode or decode text in Base64.
About Base64 Encoder
Base64 turns text into a safe set of characters that survives email headers, JSON fields, data URIs and HTTP Basic auth headers. Developers use it to build an Authorization header by hand, embed a small config in an environment variable, or check what an integration should send.
How it works
Your text is first converted to UTF-8 bytes, then encoded with the browser's btoa function. That means accented letters, Arabic, Urdu and emoji encode correctly instead of throwing an error. The output uses the standard alphabet, A-Z, a-z, 0-9, + and /, with = padding. It is not the URL-safe variant that uses - and _. The tool encodes text only, not files, and runs locally. Encoding is reversible by anyone and offers no secrecy.
How to use Base64 Encoder
- Type or paste the text you want to process in the text box above.
- Select “Run tool” and check the result before copying or downloading it.
Worked example
Input: Hello, World! Output: SGVsbG8sIFdvcmxkIQ==. The two equals signs are padding, because 13 bytes do not divide evenly into groups of three. A non-English example: café encodes to Y2Fmw6k=, because the é becomes two UTF-8 bytes before encoding.
Tips for a better result
- For HTTP Basic auth, encode username:password as one string with the colon, then send Basic followed by a space and the output.
- Watch for a trailing newline in your input. It changes the output, and some services will then reject the credential.
- If you need URL-safe Base64 for a JWT or a query string, replace + with -, / with _, and drop the = padding.
Frequently asked questions
Is Base64 a form of encryption?
No. Anyone can decode it instantly without a key. It only changes the representation of data so it fits text-only channels. Never treat Base64 as protection for passwords or personal data.
Why is the output longer than my text?
Base64 writes every 3 bytes as 4 characters, so output is about 33 percent larger, plus padding. Non-English characters take two to four bytes each in UTF-8, so they grow more.
Can I encode an image or PDF here?
No. This tool reads only the text you type or paste. To embed an image as a data URI, use a dedicated image-to-Base64 tool that reads the file's bytes.
What to check
A formatted or parsed result is not proof that code is secure, correct or production-ready. Never paste production secrets.
Read the Privacy Policy for information about local processing, connected services and advertising.