Base64 Encode
Encode text or UTF-8 strings to Base64 instantly. Unicode-safe encoding right in your browser.
Your text is encoded as UTF-8 bytes
Before encoding, the tool turns your text into UTF-8 bytes. Plain ASCII letters take one byte each, but accented letters, symbols and other scripts take two to four, and the Base64 output grows to match:
| Input | UTF-8 bytes | Base64 |
|---|---|---|
| hi | 2 | aGk= |
| café | 5 | Y2Fmw6k= |
| € | 3 | 4oKs |
| 日本 | 6 | 5pel5pys |
Any program that decodes this output has to read the bytes as UTF-8 as well. If it assumes a single-byte encoding such as Latin-1, café comes back as café. Emoji work too, since they are just four UTF-8 bytes.
Every character counts, including spaces and line breaks
Nothing is trimmed. hi encodes to aGk=, but hi followed by a space encodes to aGkg. A line break is encoded as a single newline byte, even if you pasted text with Windows line endings, because the text box stores line breaks that way.
This matters when you encode a password, an API key or a user:password pair for a header. A space or newline picked up while copying becomes part of the encoded value, and the server will reject it. user:pass should encode to exactly dXNlcjpwYXNz.
Padding and the standard alphabet
The output uses the standard Base64 alphabet, with + and /, and adds = padding whenever the byte count isn't a multiple of three. It comes out as a single line, with no line breaks every 76 characters.
If the value is going into a URL or a token that expects the URL-safe variant, convert it afterwards: replace + with -, / with _, and remove the trailing =. For example, >>>??? encodes to Pj4+Pz8/, which in URL-safe form is Pj4-Pz8_. If you need to put standard Base64 into a query string instead, run it through the URL Encoder so that +, / and = become %2B, %2F and %3D.
Mistakes that produce the wrong string
- Encoding twice. If your input already looks like Base64, encoding it again gives a longer string that has to be decoded twice.
aGk=encoded again isYUdrPQ==. - Pasting a file's contents. The box takes text. For an image, use the Image to Base64 converter, which reads the file's actual bytes.
- Expecting the result to be secret. Anyone can decode it. Base64 changes the format, not who can read it.
Frequently asked questions
Why does my Base64 end with one or two equals signs?+
They are padding. One = means the last group held two bytes and two == means it held one. Some systems drop them, but most decoders accept the string either way.
Can I encode emoji and non-Latin scripts?+
Yes. The text is converted to UTF-8 first, so Chinese, Hindi, Arabic and emoji all encode, and a UTF-8 decoder gets the same text back.
Is the text I type sent anywhere?+
No. The encoding runs in your browser as you type, and the input isn't uploaded.
Guides & deep dives
Base64 Explained: What It Is and When to Use It
Learn what Base64 encoding is, why it adds 33% overhead, how data URIs work, the base64url variant, and exactly when to encode or decode — with worked examples.
Common JSON Errors and How to Fix Them
Trailing commas, single quotes, unquoted keys, BOM, NaN — learn what breaks JSON and how to fix each error fast with a free online formatter.
JWTs Explained: Header, Payload, Signature and Security Pitfalls
Learn how JSON Web Tokens work — the three parts, signing vs encryption, the alg=none attack, cookie vs localStorage, and expiry claims — with worked examples.
CSV to JSON: Handling Headers, Quotes and Nested Data
Master CSV to JSON conversion: RFC 4180 quoting rules, delimiter problems, type inference, and flattening nested JSON back to CSV — with worked examples.
Embed this tool on your website
Free to use on blogs, school sites and intranets. Paste this code into your page's HTML; please keep the credit line.
<iframe src="https://utilityapp.lat/embed/convert/base64-encode" title="Base64 Encode" width="100%" height="600" style="border:0;max-width:760px" loading="lazy"></iframe> <p style="font-size:13px"><a href="https://utilityapp.lat/convert/base64-encode">Base64 Encode</a> by UtilityApp</p>