Base64 Encode / Decode
Convert text to Base64 and back, with correct UTF-8 handling and an optional URL-safe alphabet.
Output
Paste or type above to see the result here.
Your files stay on your device
This tool runs entirely in your browser. What you paste is processed on your device and is never sent to a server, so it is safe to use with tokens, keys and unpublished text.
How it works
- Choose Encode to turn plain text into Base64, or Decode to turn a Base64 string back into text.
- Paste the input. For decoding, both the standard alphabet with + and / and the URL-safe one with - and _ are accepted; missing padding is tolerated.
- Turn on URL-safe if the result will go into a URL, a JWT or a filename, so no characters need percent-encoding.
- Press Convert and copy the result. Accented characters, CJK text and emoji are encoded as UTF-8 bytes, matching what btoa-based encoders often get wrong.
Frequently asked questions
- Is Base64 encryption?
- No. Base64 is a reversible encoding that represents bytes using 64 printable characters. Anyone can decode it instantly. Use it for transport and embedding, never for hiding secrets.
- How does the tool handle non-ASCII text like accents, Japanese or emoji?
- The text is converted to UTF-8 bytes before encoding, and decoded output is interpreted as UTF-8. This matches what most languages and HTTP libraries do. Plain JavaScript btoa() only accepts Latin-1, which is why naive encoders throw on such characters.
- What is the difference between standard and URL-safe Base64?
- Standard Base64 (RFC 4648 section 4) uses + and / plus = padding. URL-safe Base64 (section 5) replaces them with - and _ and usually drops the padding, so the string can be used in URLs, cookies and JWTs without escaping. The decoder here accepts both.
- Why is the encoded output about a third longer than my text?
- Base64 packs 3 bytes into 4 characters, so output size is roughly 4/3 of the input plus up to 2 padding characters. That overhead is the price of using only printable characters.
- Is my data sent to a server?
- No. Encoding and decoding run entirely in the browser. You can convert API keys, connection strings or personal text without anything leaving your device.
Related tools
• JWT Decoder Paste a JSON Web Token and read its header and claims. The token never leaves your browser. • Hash Generator Get the MD5, SHA-1 or SHA-2 digest of any text, computed on your device. • JSON Formatter Paste JSON, get it indented, minified or validated instantly. Your data stays on this page. • UUID Generator Create UUID v4 or v7 identifiers in bulk, generated on your device with a secure random source.