Base64 Encoder
Encode text to Base64 with full UTF-8 support, optional URL-safe alphabet and padding control. Runs in your browser.
Processed locally in your browser. Your text is not uploaded.
What this tool does
Base64 represents binary data using 64 printable ASCII characters, which makes it safe to embed in JSON, HTML, email, data URLs and HTTP headers. This tool converts your text to Base64 using UTF-8, so accented letters, CJK text and emoji encode correctly, unlike the browser's btoa which fails on them.
Switch to the URL-safe alphabet (RFC 4648 §5) when the result will appear in a URL, a filename or a JWT: + and / are replaced with - and _. You can also drop the trailing = padding, which many URL-safe uses omit, or wrap the output at 76 characters per line as MIME expects.
Encoding is done locally in your browser with TextEncoder; nothing you type is uploaded. Remember that Base64 is an encoding, not encryption: anyone can decode it.
How to use it
- 1Type or paste the text to encode.
- 2Optionally choose the URL-safe alphabet, remove padding or wrap lines at 76 characters.
- 3Copy the Base64 output or download it as a text file.
Supported formats
Text in (encoded as UTF-8), Base64 text out (standard or URL-safe alphabet).
Privacy
This tool runs in your browser. The data you provide is processed on your device and is not sent to our servers.
Limitations
- Base64 makes data about 33% larger and offers no security. Never use it to hide secrets.
- This tool encodes text. Encoding arbitrary binary files is not supported here.
- Very large text (many megabytes) may take a moment and use significant memory in the browser.
- Line wrapping inserts newlines, which some consumers do not accept; leave it off unless you need MIME-style output.
FAQ
Why does my emoji or accented text work here but not with btoa()?
btoa only accepts characters up to U+00FF. This tool first converts your text to UTF-8 bytes and encodes those, which is the correct way to handle any Unicode text.
What is URL-safe Base64?
A variant that uses - and _ instead of + and /, so the result can sit inside URLs, cookies and filenames without extra escaping. JWTs use it without padding.
Do I need the = padding?
Standard Base64 includes it; many decoders require it. URL-safe uses (JWT, some APIs) usually omit it. Our decoder accepts both.
Is Base64 encryption?
No. It is a reversible encoding that anyone can undo. Do not rely on it for secrecy.
Related tools
Base64 Decoder
Decode Base64 and URL-safe Base64 to text with UTF-8 support. Clear errors for invalid characters, length and padding.
URL Encoder
Percent-encode text for safe use in URLs and query strings. Choose full-component or whole-URL mode. Runs in your browser.
JWT Decoder
Decode a JSON Web Token's header and payload and see exp, iat and nbf as dates. Decoding is not verification: the signature is not checked.
JSON Formatter
Format, beautify and sort JSON with syntax highlighting. Pinpoints errors by line and column. Runs locally in your browser.