Base64 encoding represents any data using 64 safe characters: A-Z, a-z, 0-9, + and /. This tool encodes text to Base64 by first converting it to UTF-8 bytes, and decodes Base64 back to text. It accepts standard and URL-safe Base64, with or without padding, and works entirely in your browser.
How to use the Base64 Encode and Decode
- Choose encode or decodePick "Encode text to Base64" or "Decode Base64 to text".
- Paste your inputType or paste the text or the Base64 string. The result updates as you type.
- Set options and copyFor encoding, tick URL-safe if the value goes into a URL or filename, then copy the result.
How Base64 encoding works
Base64 takes three bytes (24 bits) at a time and splits them into four groups of six bits. Each group is written as one of 64 characters. When the input does not divide evenly by three, one or two = signs pad the end. The result is about a third larger than the original, which is the price of being safe to send through systems that only handle plain text, such as email bodies, JSON fields, HTML attributes and HTTP headers.
Base64 works on bytes, not characters, so text has to be turned into bytes first. This Base64 encode and decode tool uses UTF-8, the encoding used by virtually every modern system. That is why é, ✓ and emoji survive a round trip here, while the browser's built-in btoa() function fails on them.
Base64 is not encryption. Anyone can decode it instantly. Never use it to hide passwords or secrets.
Standard Base64, Base64URL and decoding rules
Two characters of the standard alphabet, + and /, have special meanings in URLs. The URL-safe variant, Base64URL (RFC 4648), replaces them with - and _ and usually drops the padding. It is used in JSON Web Tokens, which you can inspect with the JWT decoder.
When decoding, the tool is deliberately forgiving about format and strict about content:
- Standard and URL-safe alphabets are both accepted, even mixed.
- Missing padding is added, and spaces and line breaks are ignored, so wrapped MIME text decodes fine.
- A
data:...;base64,prefix is stripped automatically. - Any character outside the Base64 alphabet is reported as an error instead of being skipped silently.
If the decoded bytes are not valid UTF-8 text, the data is probably a binary file. The tool then shows the first bytes as hex instead of garbled characters. For pictures, use Base64 to image.
Nothing is uploaded: encoding and decoding happen on your device.
Frequently asked questions
How do I encode text to Base64?
Choose "Encode text to Base64", type or paste your text and copy the result. The text is converted to UTF-8 bytes first, so accents and emoji are encoded correctly.
How do I decode a Base64 string?
Choose "Decode Base64 to text" and paste the string. Standard and URL-safe Base64 both work, with or without the = padding.
What is the difference between Base64 and Base64URL?
Base64URL replaces + with - and / with _ and normally omits the = padding, so the value can be used in URLs and filenames without escaping. The data it carries is identical.
Is Base64 a form of encryption?
No. Base64 is an encoding that anyone can reverse without a key. It makes data safe to transport as text, it does not keep it secret.
Why is my Base64 output longer than the input?
Base64 uses four characters for every three bytes, so the output is about 33 percent larger. Non-ASCII characters also take two to four bytes each in UTF-8.
Last updated 24 November 2026 by the TheTechFolk team.