Base64 Encoder / Decoder
Encode text to Base64 and decode Base64 to text, with UTF-8 and URL-safe support.
Text
Base64
How to use the Base64 encoder and decoder
- Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
- Type or paste your input. The result updates instantly.
- Tick URL-safe to use
-and_instead of+and/, without=padding, as used in JWTs and URLs. - Use Swap to feed the result back in and reverse the direction.
Full UTF-8 support
Text is encoded as UTF-8 first, so accented letters, Chinese, Japanese and emoji all work. The browser's built-in btoa() throws an error on these characters.
When decoding, standard and URL-safe Base64 are both accepted, line breaks are ignored and missing = padding is added for you. If the decoded bytes aren't text (for example an image), you'll be told instead of seeing garbled characters.
Examples
hello→aGVsbG8=héllo→aMOpbGxv{"alg":"HS256"}→eyJhbGciOiJIUzI1NiJ9(the start of many JWTs)
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding: anyone can decode it without a key. Never use it to hide passwords, tokens or secrets. Kubernetes Secrets, for example, are only Base64-encoded, not encrypted.
Is my data uploaded?
No. Encoding and decoding happen entirely in your browser.
Why is Base64 larger than the original?
Base64 represents every 3 bytes as 4 characters, so encoded data is about 33% larger.
What is URL-safe Base64?
A variant (RFC 4648 §5) that replaces + with - and / with _, and usually drops the = padding, so the result can be used in URLs, filenames and JWTs without escaping.
Related tools
All tools- URL Encoder / DecoderPercent-encode and decode URLs and URL components.
- Hash GeneratorGenerate MD5, SHA-1, SHA-256, SHA-512 and SHA-3 hashes of text or files, and verify checksums, in your browser.
- JSON FormatterFormat, validate and minify JSON with syntax highlighting and precise error locations.
- JSON ValidatorValidate JSON, see the exact line and column of syntax errors, and fix common mistakes.
- JSON MinifierRemove whitespace from JSON and see the original size, minified size and savings.