Base64 Encoder Decoder — encode & decode instantly
Convert text to Base64 and decode Base64 back to text, live as you type. Full UTF-8 Unicode support (accents, CJK, emoji), standard or URL-safe alphabet, optional 76-character line wrapping, file-to-Base64 encoding, and strict validation that tells you exactly why an input will not decode.
Find & Replace
Fix the input before converting — a stray character in a pasted token, or a word you keep repeating in text you are about to encode. Works on the input box in either mode.
Try an example
One click loads a real input — in the right mode — so you can see exactly what comes out.
Your session
Conversions you copy, download or swap during this visit, kept only in this tab's memory — step back and forth, restore one, or pin a conversion you want to keep handy. Nothing here is stored or sent anywhere.
Recent conversions
No conversions recorded yet — copy, download or swap a result and it will appear here.
Pinned conversions
No pinned conversions yet — convert something, then use “Pin this conversion”.
Your tools
Tools you have actually opened this session, plus any you pin as favorites. The lists live in this browser session only.
Recently used
No other tools opened yet this session — tools you visit will appear here.
Favorite tools
No favorites yet — pin a tool below.
All encoding & conversion tools
How to use the Base64 encoder decoder
- Choose Encode or Decode at the top of the tool.
- Type or paste your input — or drop a file onto the tool to encode it. The result updates live.
- Adjust the options if you need them: URL-safe alphabet for URLs and tokens, no padding, or MIME-style 76-character wrapping for email.
- Copy the result, download it as a text file, or — when decoding — download the recovered bytes as a file. Use output as input to flip direction and verify a round trip.
Worked example
How Base64 works
Base64 takes input three bytes at a time. Three bytes are 24 bits, which split neatly into four groups of 6 bits. Each 6-bit group (a value from 0 to 63) maps to one character in the alphabet A–Z a–z 0–9 + /. If the final group has only 1 byte left over, it produces 2 characters plus == padding; 2 leftover bytes produce 3 characters plus one =. That fixed 3-bytes-to-4-characters ratio is why Base64 output is always about 33% larger than the input — 100 bytes become 136 characters — and why it is an encoding for transport, not a compression or security tool.
Standard vs URL-safe Base64
| Variant | Characters 62 / 63 | Padding | Used for |
|---|---|---|---|
| Standard (RFC 4648 §4) | + and / | = kept | Email (MIME), PEM certificates, data URLs, JSON payloads |
| URL-safe (RFC 4648 §5) | - and _ | often omitted | URLs, filenames, JWT tokens, web API parameters |
Decoding here accepts either alphabet's +/- and //_ characters, tolerates missing padding, and ignores whitespace — so Base64 copied out of a wrapped email or a JWT will still decode. The URL-safe option mainly controls what the encoder produces.
Common uses
- Data URLs: embedding small images or fonts inline in HTML/CSS as data:image/png;base64,…
- Email: MIME attachments are Base64 with lines wrapped at 76 characters.
- APIs & tokens: Basic-auth headers, JWT parts and API payloads carry Base64 or URL-safe Base64.
- Certificates & keys: PEM files are Base64 wrapped at 64 characters between header/footer lines.
Important: Base64 is not encryption and not hashing. It is fully reversible by anyone, instantly. Never rely on it to hide passwords, API keys or personal data.
Where encoded data goes next
Base64 is almost never the final step. Encoded output usually ends up embedded as a data URL in HTML or CSS, sitting in an Authorization: Basic header, carried inside a JSON payload, or placed in a link or token in its URL-safe form. Decoded output is often JSON that needs checking or reformatting. The “Send output to…” bar above the examples carries the current result into the URL Encoder/Decoder, HTML Encoder/Decoder, JSON Formatter, JSON Validator or QR Code Generator for you — and text chained in from other tools is loaded here automatically, into Decode mode when it looks like Base64 and Encode mode when it does not.
Frequently asked questions
What is Base64 encoding?
Base64 represents binary data — or text — using only 64 printable ASCII characters (A–Z, a–z, 0–9, + and /). It lets binary data travel safely through systems designed for text, such as email, URLs, JSON and HTML. Every 3 bytes of input become 4 Base64 characters, so the output is about 33% larger.
Is Base64 encryption?
No. Base64 is an encoding, not encryption — anyone can decode it instantly with no key. Never use Base64 to protect passwords, tokens or secrets; it only changes how data looks, not who can read it.
Does this tool handle Unicode and emoji?
Yes. Text is first converted to UTF-8 bytes and then encoded, so accented characters, Chinese, Arabic, emoji and any other Unicode text encode and decode correctly — unlike a plain btoa() call, which fails outside Latin-1.
What is URL-safe Base64?
Standard Base64 uses + and /, which have special meanings in URLs. URL-safe Base64 (RFC 4648 §5) replaces + with - and / with _, and often omits the = padding, so the result can sit in a URL or filename without escaping. Tick “URL-safe alphabet” to use it in either direction.
Why does my Base64 fail to decode?
The most common causes are characters outside the Base64 alphabet (whitespace from a wrapped email is ignored here), a length that is not a multiple of 4 after padding, or missing/incorrect = padding. This tool reports exactly which problem it found and where.
Why is Base64 output longer than the input?
Base64 packs 3 bytes into 4 characters, a fixed 4:3 ratio, so output is about 33% larger than the input, plus up to 2 padding characters. 100 bytes become 136 Base64 characters.
Is my data uploaded or stored?
No. Encoding and decoding happen entirely in your browser — files you drop are read locally and never leave your device.
How do I encode a whole file as Base64?
Drop the file onto the drop zone in the tool, or tap the zone to choose a file. The file is read locally in your browser and converted to Base64 — nothing is uploaded. Files up to 20 MB work comfortably; the output is about 33% larger than the file. In Decode mode, the “Download decoded file” button reverses the process and saves the recovered bytes.
Where does Base64 output usually go next?
Common next steps are embedding it as a data URL in HTML or CSS, placing it in an Authorization: Basic header, carrying it inside a JSON payload, or putting URL-safe Base64 into a link or token. The “Send output to…” bar on this page carries the current result straight into the URL Encoder/Decoder, JSON Formatter, QR Code Generator and other suite tools.
Related encoding & conversion tools
About this tool
The Base64 Encoder Decoder is one of 33 free utilities in the Online Utilities Suite at dev.conversiontools.online. Every tool runs entirely in your browser — your text and files are never uploaded, stored or tracked — so conversions are instant and private, even for large inputs.
Privacy
This page processes everything locally in your browser: no account, no uploads, and nothing you type or drop here is stored or sent to a server. Advertising on this site is served by Google AdSense, which may use cookies to personalize ads; you can opt out of personalized advertising in your Google ad settings.