Base64 Encoder & Decoder
Encode and decode Base64 online. Supports UTF-8, URL-safe mode, and file uploads. Instant results — no data sent to any server.
- Free, no sign-up
- REST + MCP
- Updated
- Reviewed by Olgun Ozoktas
Input
Output
How to Encode and Decode Base64 Online
-
Choose your mode
Select Encode to convert plain text or binary data into Base64, or select Decode to convert a Base64 string back to its original form. Toggle URL-Safe Mode if you need output suitable for URLs or filenames. -
Enter or paste your input
Type or paste your text into the input field. You can also click Upload File to load an image, document, or any binary file directly from your device. -
View the result instantly
The output appears in real time as you type. There is no submit button to press. The tool processes your input in your browser immediately, with zero server round-trips. -
Copy or download
Click Copy to place the result on your clipboard, or click Download to save it as a file. Use Swap to quickly reverse the direction and decode what you just encoded.
Common Use Cases
Embedding Images in CSS and HTML
Encoding API Credentials
Creating Data URIs
Email Attachments and MIME Encoding
Why use Base64 encoding?
Base64 is a binary-to-text encoding scheme defined in RFC 4648. It converts any binary data into a string of 64 printable ASCII characters: A-Z, a-z, 0-9, +, and /. The = character is used for padding when the input length is not a multiple of three bytes. This encoding is fundamental to how the modern web handles binary data in text-only contexts.
The encoding process works by taking three bytes (24 bits) of input and splitting them into four 6-bit groups. Each group maps to one of the 64 characters in the Base64 alphabet. Because 3 input bytes become 4 output characters, the encoded result is always roughly 33% larger than the original. A URL-safe variant replaces + with - and / with _ so the output can be used in URLs, cookies, and filenames without additional escaping.
Common applications include embedding images as data URIs in HTML and CSS, encoding binary attachments in email (MIME), transmitting credentials in HTTP Basic Authentication headers, and storing binary blobs in JSON or XML documents. Developers also use Base64 when working with JWT tokens, image-to-base64 conversion, and URL encoding. This tool processes everything in your browser. No data is ever sent to a server, making it safe for encoding API keys, tokens, and other sensitive strings during development.
How it compares
Base64 Encoding Tips
- Base64 increases data size by approximately 33%. A 75 KB file becomes about 100 KB after encoding. Factor this overhead into bandwidth and storage calculations.
- Use URL-safe Base64 (RFC 4648 Section 5) when the encoded string appears in URLs, query parameters, or filenames. It replaces + with - and / with _ to avoid percent-encoding issues.
- Base64 is not encryption. Never use it to hide passwords, API keys, or sensitive data. Use proper encryption algorithms like AES-256 instead.
- For web performance, only Base64-encode images smaller than 2-5 KB. Larger images are better served as separate files so browsers can cache them independently.
- When decoding, watch for missing padding characters (=). Standard Base64 strings have a length that is a multiple of 4. Some systems strip padding, which can cause decoding errors.