Base64 Encoder and Decoder
Convert text to Base64 and back, with correct UTF-8 handling and an option for the URL-safe alphabet.
56 characters
How it works
Text is encoded to UTF-8 bytes with TextEncoder, then to Base64 with btoa, which avoids the classic non-ASCII bug.
Decoding reverses the steps with atob and TextDecoder, and reports an error for invalid input.
URL-safe mode swaps + and / for - and _ and strips padding, as used in JWTs and query strings.
Nothing is uploaded.
Save snippets like this to your DEVAE profile and share them with collaborators. Free for individuals.
Sign up freeFrequently asked questions
btoa only accepts Latin-1. This tool encodes to UTF-8 bytes first, which is what you want for emoji and non-English text.
The same encoding with - and _ instead of + and /, and usually without = padding, so it can go in URLs and JWTs unchanged.
No. It is a reversible encoding anyone can decode. Never use it to hide secrets.
No. Everything runs in your browser.
