Base64 Encode & Decode Online
- This tool runs entirely in your browser. Nothing you enter or upload is sent to a server.
Text
Base64
Result appears here.About this tool
Base64 represents binary data using 64 printable ASCII characters, which makes it safe to embed in JSON, URLs, emails and data URIs. Every 3 bytes of input become 4 characters of output, so encoded data is about 33% larger.
This tool encodes text as UTF-8 before converting, so Hindi, accented characters and emoji round-trip correctly — something the browser’s built-in btoa() cannot do on its own. For example, hello becomes aGVsbG8=, and Hello, नमस्ते! 😀 UtilDojo encodes to SGVsbG8sIOCkqOCkruCkuOCljeCkpOClhyEg8J+YgCBVdGlsRG9qbw==.
Choose URL-safe mode to get base64url output (RFC 4648 §5), which swaps + and / for - and _ and drops the = padding. It’s the variant used inside JWTs. The same text subjects?_d>> gives c3ViamVjdHM/X2Q+Pg== in standard form and c3ViamVjdHM_X2Q-Pg in URL-safe form. The decoder accepts both forms automatically, ignores spaces and line breaks, and restores missing padding.
If decoding fails, the message says the input contains characters that are not valid Base64, which usually means a stray quote, a prefix such as data:image/png;base64, that should be removed, or a partial copy. A decode that succeeds but shows garbled text means the bytes were not UTF-8 text, for instance an image. For that case use the Image to Base64 tool. Conversion happens in your browser and nothing is uploaded.
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding, not encryption — anyone can decode it. Never use it to hide passwords or secrets.
Why does my decoded text look garbled?
The original data was probably binary (an image or file) rather than text, or it was encoded with a non-UTF-8 character set.
Is my data sent anywhere?
No. Encoding and decoding happen entirely in your browser using JavaScript.
What is the = at the end?
Padding, which makes the length a multiple of 4. URL-safe output leaves it off, and the decoder adds it back, so both forms decode.
Can I decode a Basic Auth header?
Yes. Remove the word Basic, paste the rest and decode to get username:password. This is also a reminder that Basic Auth is not encrypted unless it travels over HTTPS.
Does Base64 make data smaller?
No, it makes it about a third larger, because 3 bytes become 4 characters. It exists to carry binary data through text-only channels, not to compress it.