Base64 Encoder / Decoder
Encode or decode Base64 for text and files — UTF-8 safe, URL-safe option, fully in-browser.
100% in your browser — files never leave your device
Output appears here.
Encode a file
What this Base64 tool does differently
Standard Base64 uses 64 printable characters to represent arbitrary bytes as ASCII text, which is why it shows up in data URIs, email attachments, and JWT segments. This tool encodes by converting your text to UTF-8 bytes first, then Base64-encoding those bytes — the reverse of the naive approach most quick implementations use.
The naive shortcut — calling btoa() directly on a string — only works for Latin-1 characters (code points 0–255). Paste in an emoji or a CJK character and btoa() throws, because those characters need more than one byte. Encoding the UTF-8 byte array first sidesteps that failure entirely, so any Unicode input round-trips correctly.
The URL-safe toggle swaps + for -, / for _, and strips = padding, which matters when the output has to sit inside a query string or path segment without additional escaping. Base64 is an encoding, not encryption — anyone can decode it, so it isn't a place to hide secrets.
Frequently asked questions
Is my data uploaded anywhere?
No. All encoding and decoding runs entirely in your browser using built-in JavaScript APIs. Nothing leaves your device.
What is URL-safe Base64?
Standard Base64 uses + and / characters that have special meaning in URLs. URL-safe Base64 replaces + with - and / with _, and strips = padding — making the output safe to include in query strings and path segments without further escaping.
Why does naive btoa() break on non-ASCII text?
btoa() only handles Latin-1 (byte values 0–255). Multi-byte UTF-8 characters like emoji or CJK glyphs have code points above 255, which throws. This tool first encodes text to a UTF-8 byte array, then Base64-encodes those bytes — so any Unicode string works correctly.
Related tools
How to use Base64 Encode/Decode
Use the free tool above, or check the options on your device. No subscription or account is required for the browser tool.
Base64 Encode/Decode in your browser
Free browser tool — no installation
- Choose Encode or Decode and enter text; for encoding you can also select a file.
- Toggle URL-safe when required by your destination.
- Copy the generated output.
Base64 is reversible encoding, not encryption. Large files create large strings and can exhaust browser memory.
Processing happens on your device in the browser. Large files may exceed your device’s available memory.
Base64 Encode/Decode on Mac
Free browser tool — no installation
Use the tool on this page in Safari, Chrome, or Firefox. These steps use the browser tool; they do not require an extra app.
- Choose Encode or Decode and enter text; for encoding you can also select a file.
- Toggle URL-safe when required by your destination.
- Copy the generated output.
Base64 is reversible encoding, not encryption. Large files create large strings and can exhaust browser memory.
Processing happens on your device in the browser. Large files may exceed your device’s available memory.
For file tools, choose a copy of the original. Find saved results in your browser’s Downloads menu; your browser may ask where to save them. If processing fails, keep the original and try a smaller file or a desktop browser.
Base64 Encode/Decode on Windows
Free browser tool — no installation
Use the tool on this page in Edge, Chrome, or Firefox. These steps use the browser tool; they do not require an extra app.
- Choose Encode or Decode and enter text; for encoding you can also select a file.
- Toggle URL-safe when required by your destination.
- Copy the generated output.
Base64 is reversible encoding, not encryption. Large files create large strings and can exhaust browser memory.
Processing happens on your device in the browser. Large files may exceed your device’s available memory.
For file tools, choose a copy of the original. Find saved results in your browser’s Downloads menu; your browser may ask where to save them. If processing fails, keep the original and try a smaller file or a desktop browser.
Base64 Encode/Decode on iPhone / iPad
Free browser tool — no installation
Use the tool on this page in Safari or another current browser. These steps use the browser tool; they do not require an extra app.
- Choose Encode or Decode and enter text; for encoding you can also select a file.
- Toggle URL-safe when required by your destination.
- Copy the generated output.
Base64 is reversible encoding, not encryption. Large files create large strings and can exhaust browser memory.
Processing happens on your device in the browser. Large files may exceed your device’s available memory.
For file tools, choose Browse in the file picker to find a document in Files. A result may open in a preview; use Share → Save to Files when offered. If processing fails, keep the original and try a smaller file or a desktop browser.
Base64 Encode/Decode on Android
Free browser tool — no installation
Use the tool on this page in Chrome or another current browser. These steps use the browser tool; they do not require an extra app.
- Choose Encode or Decode and enter text; for encoding you can also select a file.
- Toggle URL-safe when required by your destination.
- Copy the generated output.
Base64 is reversible encoding, not encryption. Large files create large strings and can exhaust browser memory.
Processing happens on your device in the browser. Large files may exceed your device’s available memory.
For file tools, choose a document from the system file picker. Saved downloads are usually available in your browser’s Downloads menu or your file manager. If processing fails, keep the original and try a smaller file or a desktop browser.