Base64 encoder and decoder
Encode text to Base64 or decode it back, with full UTF-8 support including accented and Cyrillic characters. Convert a file into a data URI.
Free, no sign-up. Everything runs in your browser. Your data never leaves your device.
How to use
- 1Choose encode or decode.
- 2Enter the text.
- 3Copy the result.
- 4For a file, select it and copy the data URI.
About this tool
Base64 turns binary data into text made of 64 safe characters. It is used to embed images in HTML and CSS, send files through JSON APIs, email attachments and authentication headers. Base64 is not encryption: anyone can decode it, so never use it to hide data.
What Is Base64 and What Is It Used For
Base64 is a way to represent any sequence of bytes using 64 characters from the ASCII table: uppercase and lowercase letters, digits, plus and slash. The idea is simple: many systems that data passes through (email protocols, JSON, HTML attributes, URL parameters) are not built to safely transmit binary bytes, so the data is first "packed" into plain text.
That is why you encounter Base64 everywhere: an image embedded directly in CSS via a data: URI, an email attachment, an authentication token in an HTTP request header, a field in the JSON body of an API call. The tool on this page works in both directions, with UTF-8 support, so Serbian Latin letters and Cyrillic pass through without distortion.
It is key to understand what Base64 is not: it is not encryption or protection. Anyone who gets the code can decode it in a second, without a key or password. If data needs to be hidden, you need real cryptography, not Base64.
How to Encode Text or a File to Base64
The procedure is always the same, regardless of what you are encoding:
- Paste text into the input field or select a file.
- The tool takes the bytes of the record, usually UTF-8, and splits them into groups of three bytes.
- Each group is translated into four Base64 characters. If one or two bytes remain at the end,
=characters are added as padding. - You copy the resulting code and use it wherever you need it.
A practical example: the text Zdravo in UTF-8 has 6 bytes and produces WmRyYXZv. The Serbian letter č takes up two bytes, so the word čaj produces xI1hag==. Those = characters at the end are not an error, they simply indicate how many bytes were padded.
With files, watch the size. A 100 KB image has about 133 KB of text after encoding, and the entire content must fit into a single string. For a data URI in CSS this is acceptable for icons and smaller images, but not for large photos, because such CSS loads every time the page is opened.
Advanced tip: when Base64 goes into a URL or a file name, use the URL safe variant, where + and / are replaced with - and _, and = is often omitted. Standard and URL safe Base64 are not always interchangeable, so check what the other system expects.
Why Base64 Text Looks Longer and How to Check It
Base64 uses 64 characters, and each character carries 6 bits. Since a byte has 8 bits, more characters than bytes are needed, roughly a quarter more, plus any =. That is why the text always looks longer than the original, and that is normal, not a tool error.
When decoding fails, the cause is almost always one of these:
- the code is cut off or part of it was lost when copying from an email or chat message;
- spaces, line breaks or invisible characters got into the code;
- standard and URL safe Base64 are being mixed;
- the text was encoded in a different code page, so Serbian letters show up as question marks or strange symbols.
Checking is simple: the length of valid Base64 code is always divisible by four, and characters outside the base set are rare. If the decoded text looks correct but the letters are wrong, the problem is in the character encoding, not in the Base64 code itself.
Most Common Mistakes When Working with Base64
The biggest mistake is treating Base64 code as a secret. Passwords, API keys and personal data in Base64 format remain completely readable to anyone who intercepts them. If a token is transmitted over HTTPS, the protection comes from TLS, not from encoding.
Another common mistake is double encoding. If you decode code and then re encode the same result, you will get a different string and it will be hard to spot where the problem arose. Always keep track of which direction you are going and keep the original until you confirm the result is correct.
The third is mixing character encodings. When the tool receives text, it must know that it is UTF-8, otherwise š and đ can end up as unreadable sequences. That is why, when exchanging data with another system, always specify the encoding, for example in the header Content-Type: application/json; charset=utf-8.
When Base64 becomes part of a larger system, say an API that receives files or token processing on the server, mistakes multiply quickly. In such cases EVI Solutions can help with architecture and integration, while this tool serves you well for quickly checking a single piece of text or a file.
Frequently asked questions
Is Base64 encryption?
No. It is just an encoding that anyone can reverse.
Why is Base64 longer than the original?
Base64 increases size by about 33%.
Does it support special characters?
Yes, text is encoded as UTF-8, so accents and Cyrillic are supported.