Base64 Encoder / Decoder
Encode and decode Base64 strings. UTF-8 safe, entirely client-side.
How to use
Choose Encode to convert text into Base64, or Decode to reverse a Base64 string back into text. The output pane updates instantly as you type.
Click Copy in the output header to copy the result to your clipboard, or Download to save it as a text file. Reset clears everything.
Keyboard shortcuts
Common actions are bound to keyboard shortcuts. They work anywhere on this page while the tool is loaded.
| Shortcut | Action |
|---|---|
| ⌘ K / Ctrl K | Focus the input pane |
| ⌘ Enter / Ctrl Enter | Copy output to clipboard |
| ⌘ / / Ctrl / | Toggle between Encode and Decode |
When to use Base64
Base64 is a text-safe representation of binary data. Common uses include:
- Embedding binary data in JSON, XML, or URL parameters
- HTTP Basic Authentication headers
- Data URIs for inline images, fonts, or SVG
- Email attachments (MIME)
- Storing credentials or tokens in text-only environments
Not for confidentiality. Base64 is encoding, not encryption. Anyone can decode it. Never use it as a way to hide sensitive data.
Options
URL-safe: replaces + with - and / with _. Use this for Base64 that will appear in URLs or JWTs.
Strip padding: removes trailing = characters. Padding is optional in some contexts and decoders will typically accept both.
Line-wrap 76: wraps the output at 76 characters per line. Required for MIME (email) format.
Text encoding: how your text is converted to bytes before encoding. UTF-8 is the modern standard and correct in almost every case. Legacy systems may use Latin-1 or UTF-16.
Unicode and UTF-8
This tool encodes and decodes UTF-8 correctly. Emoji, Cyrillic, Chinese, Arabic — all handled as bytes rather than as characters.
The native browser functions btoa and atob only handle Latin-1 and will fail on characters outside that range. This tool wraps them with proper UTF-8 conversion, so any Unicode string round-trips correctly.
Privacy
Everything runs in your browser. No input, output, or metadata is sent to any server. The page works offline once loaded.
Frequently asked questions
Is Base64 the same as encryption?
No. Base64 is encoding — a reversible representation of bytes as text. Anyone who receives a Base64 string can decode it without a key. Never use Base64 to hide sensitive data.
Why does my Base64 string end with = or ==?
The equals signs are padding. Base64 encodes in 3-byte groups; when the input length is not a multiple of 3, one or two = characters are appended so the output length is always a multiple of 4.
Can I encode binary files with this tool?
Yes. Drag a file onto the drop zone or click it to browse. The file is read as bytes and encoded directly. All processing happens in your browser.
Why does my Unicode text encode differently than in other tools?
This tool uses UTF-8 as the byte representation before encoding, which is the modern standard. Some older tools use Latin-1 or UTF-16 and produce different Base64. UTF-8 is what you want in almost every real-world case.
Is my data sent anywhere?
No. All encoding and decoding happens in your browser using native JavaScript APIs. Nothing is transmitted, logged, or stored server-side.