The search that brought you here probably said "files", so let us be direct before anything else: the Base64 Text Encoder/Decoder on Ovatly encodes text. It has no file upload, and pasting a file's raw contents into it is not a shortcut around that. What this guide can do is show you the text encoding properly, step by step, and then answer the files question plainly: why binary files do not belong in a text tool, and where they belong instead.
That split is not a limitation invented for this page. Base64 exists to carry data through text-only channels like JSON, email and data URIs, and the tool is built for the text side of that job, with Unicode handled correctly. Files are the other side, and they need a different tool.
Contents
- Quick answer
- What Base64 is actually for
- How to encode text to Base64, step by step
- Worked example: three strings encoded
- The files question, answered honestly
- Limitations and honest warnings
- Common mistakes
- FAQs
- Conclusion
Quick answer
To encode text, open the Base64 Text Encoder/Decoder, paste your text, and press Encode to Base64. Copy the result. The same box works in reverse with Decode from Base64, and the tool is fully Unicode safe, so accented characters, emoji and non-Latin scripts survive the round trip intact. For files, the honest answer is that this is the wrong tool: it accepts text only. Binary data belongs in a file tool, and an image belongs in the Base64 Image Encoder in the Image Tools category, which produces a data URI.
What Base64 is actually for
Some channels can only carry plain text safely: JSON documents, email, and data URIs are the examples the tool itself names. Raw bytes do not survive those channels reliably, because control characters and non-text bytes get mangled or rejected along the way. Base64 solves that transport problem by representing data using only letters, digits and a few safe symbols, so the result can travel anywhere text can travel.
Because the encoding uses a smaller alphabet than the raw data, the output is about a third larger than the input. That overhead is normal; it is the price of making data safe for text-only channels. Keep it in mind for files especially: encoding a large binary file inflates it by roughly a third before it goes anywhere, which is one more reason file encoding is a deliberate step with a proper tool, not something to improvise in a text box.
How to encode text to Base64, step by step
- Open the Base64 Text Encoder/Decoder.
- Paste plain text into the box. The same tool works in both directions, so text and Base64 share one input.
- Press Encode to Base64.
- Copy the result. If you later paste a Base64 string instead and press Decode from Base64, read any validation error: the tool reports input that is not real Base64, or that does not decode to UTF-8 text, rather than printing garbage.
Everything runs in your browser, and the encoder is fully Unicode safe. That last point matters more than it sounds: a text encoder that treats characters as single bytes will corrupt accented letters and lose emoji entirely, while this one carries them through exactly.
Worked example: three strings encoded
The tool's own example is the classic test string. Encoding "Hello, World!" gives:
SGVsbG8sIFdvcmxkIQ==
The two equals signs at the end are padding. Base64 works in groups of four characters, and the padding marks how many bytes were in the final partial group, so strings can end with one = or two ==, or with none.
The second example shows the Unicode handling. The word "café" encodes to Y2Fmw6k=, with a single padding character, and decodes back to "café" exactly. The accented character survives because the tool encodes the text's UTF-8 bytes rather than assuming every character is one byte.
A third, shorter check: the word "Ovatly" encodes to T3ZhdGx5, no padding at all, because its bytes fill the final group exactly. Three strings, three padding outcomes, all from the same rule.
The files question, answered honestly
A file is not text. A PDF, a zip archive, an executable or a photo is a stream of bytes, most of which are not characters at all. This tool works on text, and it defends that boundary: if the bytes behind a Base64 string are not valid UTF-8 text, the tool says so instead of printing mojibake. Its own guidance for that case is short: use a file tool for binary data.
So what do you do with an actual file?
- Images have a dedicated route. The tool's own FAQ sends you to the Base64 Image Encoder in the Image Tools category, which produces a data URI, the form you need for embedding an image in HTML, CSS or JSON.
- Other binary files (documents, archives, executables) belong in a file tool built for them, one that reads the file as bytes and encodes those bytes. That step is not offered here, and any page that tells you to paste a binary file into a text box is setting you up for a corrupted result.
- Text files are the genuine middle case. If a file's contents are plain text, those contents are text, and you can paste them in and encode them like any other text. What you get back is the encoding of the text, which is exactly what you want for a config snippet, a certificate block or a text payload.
One more honesty point: Base64 is an encoding, not encryption. Encoded file contents, like encoded text, can be decoded by anyone who sees the string. Encoding a document does not protect it in transit or at rest; it only makes it safe for text channels.
Limitations and honest warnings
This tool encodes and decodes text, in your browser, and nothing else. It does not accept file uploads, and it will not rescue binary data that was pasted in as if it were text: non-UTF-8 bytes produce an error message, by design.
Decoding is forgiving in the ways that are safe. It accepts standard Base64 and the URL-safe variant (with - and _), with or without padding, because real-world strings arrive in all of those forms. Encoding output runs about a third larger than the input, which is the normal Base64 overhead and worth remembering before you embed anything long.
And the warning that belongs on every Base64 page: never use Base64 to protect secrets. It is instantly reversible by anyone, with no key. Passwords belong in a proper hash like bcrypt, never in Base64.
Common mistakes
- Trying to encode a file in the text tool. There is no upload here. Images go to the Base64 Image Encoder in Image Tools; other binary data goes to a file tool.
- Pasting binary contents as if they were text. Bytes that are not valid UTF-8 produce an error, correctly. That error is the tool protecting you from a corrupted round trip.
- Treating Base64 as a security measure. It is a transport format. Anything encoded is public to anyone who can see it, file contents included.
- Assuming a missing
=means the string is broken. Padding marks the final partial group, and the decoder accepts strings with or without it. - Forgetting the size overhead. Encoded output is about a third larger than the input, which adds up quickly on long payloads.
FAQs
Why does the output end with = signs?
Base64 works in groups of four characters. The = signs are padding that mark how many bytes were in the final partial group.
Can I encode an image here? This tool is for text. For images, use the Base64 Image Encoder in the Image Tools category, which produces a data URI.
Is Base64 safe for passwords? No. It is instantly reversible by anyone. Passwords belong in a proper hash like bcrypt, never in Base64.
Can I encode a whole file with this tool? No. This tool encodes text only and has no file upload. If the bytes behind a string are not valid UTF-8 text, the tool says so instead of printing mojibake. Binary data belongs in a file tool, and images belong in the Base64 Image Encoder.
Does the decoder accept the URL-safe variant?
Yes. Decoding accepts standard Base64 and the URL-safe variant (with - and _), with or without padding.
Conclusion
For text, the job is a paste, a press and a copy, and the Base64 Text Encoder/Decoder handles Unicode text, both Base64 variants and missing padding without corrupting anything. For files, the honest answer is to use the tool built for the file type: the Base64 Image Encoder for images, a file tool for other binary data. Format mismatches cause a quieter class of bug in timestamps, where a value in the wrong unit or zone shifts a date by a day; Timestamp Conversion Mistakes That Cause Off-By-One-Day Bugs walks through those. For more tools like these, see the Developer Tools guide archive.