Base64 Encoder & Decoder
A premium Base64 encoder/decoder that works entirely in your browser. Encode plain text to Base64 or decode Base64 back to text with full Unicode, emoji, and multiline support. Features live mode with auto-debounce, intelligent auto-detect, file upload support, character encoding selection, hex and binary previews, and detailed statistics — all without sending any data to a server.
Text to encode
Encoded Base64
Keyboard Shortcuts
Examples
Pre-built examples to see Base64 encoding in action.
Simple Text
Basic text encoding example
Hello, World! Welcome to ForgePlug Base64 Encoder.
JSON
JSON object encoded as Base64
{ "name": "ForgePlug", "version": "1.0.0", "tools": [ "Base64 Encoder"...
JWT Sample
JWT token structure (header.payload.signature) in Base64
{ "alg": "HS256", "typ": "JWT" }. { "sub": "1234567890", "name": "John D...
Lorem Ipsum
Multi-line text paragraph
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor i...
Unicode
Unicode characters and special symbols
Unicode support: ñóüêç宆™€£¥§©°±×÷¿¡«»‽∞≈≠≤≥√∫∑∂∆∏∑—–•·…‰■□▪▫▲▼◆◇○●◐◑★☆☐☑☒✓✔✕✖✗...
Emoji
Emoji and emoticons
🎉✨🚀🌟💡🎯🔥💪⚡🎨💻📱🌍🌈🍕🎸🎭🎪🎢🎡🎠🎪🎭🎨🎯🎯🔥💪⚡🎉✨🚀🌟💡🎯🔥
Frequently Asked Questions
What is Base64?
Why is Base64 used?
Is Base64 encryption?
How do I decode Base64?
Is my data uploaded to a server?
Does Base64 increase file size?
Can I encode UTF-8 and Unicode?
Can I encode entire files?
Base64 Encoding: How It Works and When to Use It
A practical guide to the encoding format that powers email attachments, data URIs, and JSON APIs.
Base64 is one of those technologies that most developers encounter regularly but few deeply understand. It appears in email headers, API authentication, JWT tokens, data URIs, and countless other contexts. Knowing what Base64 actually does — and more importantly, what it does not do — is essential for using it correctly and avoiding common misconceptions.
What Base64 Encoding Does
Base64 is a binary-to-text encoding scheme that represents arbitrary binary data using a set of 64 printable ASCII characters: uppercase A–Z (0–25), lowercase a–z (26–51), digits 0–9 (52–61), plus the plus sign (+ for 62) and forward slash (/ for 63). An equals sign (=) is used as padding when the input length is not a multiple of three bytes.
The encoding process works in groups of three input bytes (24 bits), which are split into four 6-bit groups. Each 6-bit group maps to one of the 64 characters in the Base64 alphabet. This means every 3 bytes of binary data becomes 4 bytes of Base64 text — an overhead of approximately 33%.
The purpose of Base64 is not security or compression — it is compatibility. Many systems were designed to handle only ASCII text (email protocols, URL parameters, JSON values, HTML attributes), but needed to transmit binary data like images, encrypted content, or serialized objects. Base64 provides a safe way to embed binary data in text-only contexts without corruption from character encoding conversions, line-ending transformations, or other text processing.
Common Use Cases
Data URIs are one of the most visible uses of Base64. When you embed an image directly in an HTML file or CSS stylesheet using a data: URL, the image data is Base64-encoded and included inline. This eliminates a network request but increases the file size by about 33% — a worthwhile trade-off for small icons and decorative elements, but impractical for large images.
HTTP Basic Authentication sends credentials as Authorization: Basic base64(username:password). The server decodes the Base64 string to extract the credentials. While Base64 is not encryption, the Basic scheme is typically used over HTTPS, which provides the actual security through TLS encryption.
JWT (JSON Web Tokens) use Base64URL — a URL-safe variant that replaces + with -, / with _, and omits padding — to encode the header and payload segments. The signature is also Base64URL-encoded, producing the three-part token format that API developers work with daily.
Email attachments (MIME) encode binary files as Base64 text within email messages, allowing images, PDFs, and other binary content to be transmitted through text-based email protocols like SMTP.
Storing binary data in JSON is another practical use case. When an API needs to return binary data (like a generated file or image) as part of a JSON response, Base64 encoding allows the binary content to be included as a string value.
Base64 Is Not Encryption
This is the most important misconception to address: Base64 encoding provides absolutely no security. Anyone can decode a Base64 string instantly using any Base64 decoder, including this tool. Base64 does not use a key, does not involve a mathematical transformation designed for secrecy, and was never intended for security purposes.
Never store passwords, API keys, or sensitive data in Base64 thinking it provides protection. If you need to encrypt data, use established algorithms like AES-256, RSA, or ChaCha20. Base64 is purely an encoding format for data transmission compatibility.
Unicode and UTF-8 Considerations
When encoding text that contains Unicode characters (accented letters, Chinese characters, emoji), the text must first be converted to UTF-8 bytes before Base64 encoding. The standard btoa() function in JavaScript only works with Latin-1 characters, so encoding Unicode text requires using TextEncoder to produce UTF-8 bytes first. ForgePlug's Base64 tool handles this automatically, supporting the full range of Unicode characters including emoji.
Size Impact
Base64 increases data size by approximately 33%. For every 3 bytes of input, 4 bytes of output are produced. This overhead is the inherent cost of representing 8-bit binary data using only 6 bits per character. For large files, this can be significant — a 1MB image becomes approximately 1.33MB when Base64-encoded. When size matters, consider whether Base64 is the right choice or whether binary transfer would be more appropriate.
Frequently Asked Questions
Everything you need to know about encoding and decoding Base64
What is Base64?
Why is Base64 used?
Is Base64 encryption?
How do I decode Base64?
Is my data uploaded to a server?
Does Base64 increase file size?
Can I encode UTF-8 and Unicode?
Can I encode entire files?
Guides & Articles
Learn how to get the most out of this tool with our in-depth guides.
Tool Overview
A closer look at Base64 Encoder & Decoder — how it works, who it's for, and where it fits in your workflow.
Base64 is an encoding scheme that represents binary data as a safe ASCII string using 64 characters (A-Z, a-z, 0-9, +, /, and = padding). It exists because many transport layers — email, JSON, URLs, HTTP headers — were designed for text and choke on raw bytes. When you see a long string ending in "==" in an API response, a data URL, or an email attachment, you're looking at Base64-encoded content.
The Encoder & Decoder converts between plain text and Base64 with full Unicode support, so emoji, accented characters, and multiline text survive the round-trip intact. Smart auto-detection recognizes whether your pasted content is already Base64 and switches direction automatically, while file support lets you encode any binary upload or decode its payload. Live mode updates the result as you type, with optional hex and binary previews for learning or debugging.
Encoding is not encryption — Base64 is trivially reversible, so never use it to protect secrets. Use it for data interchange, embedding small assets, and debugging protocols. Every transformation happens locally in your browser, so sensitive payloads like tokens or config values you paste are never transmitted anywhere.
A few everyday debugging jobs lean on Base64 without most people realizing it. A JWT's header and payload segments are Base64URL-encoded JSON — paste either segment in here to see the raw claims before they're signature-verified. An image can be inlined directly into HTML or CSS as a data URI by encoding the file, skipping a separate network request for small icons or logos. And an HTTP Basic Auth header is just "username:password" Base64-encoded after the word "Basic" — decoding one is often the fastest way to confirm what credentials a request is actually sending.
Key Features
Everything you get with this tool, at a glance.
Encode & Decode
Convert text to Base64 and back with instant, reversible results.
Smart Auto-Detect
Automatically determines whether your input is Base64 and picks the right direction.
File Support
Encode any local file or decode an uploaded payload without leaving the page.
Full Unicode & UTF-8
Emoji, accented characters, and multiline text encode and decode correctly.
Hex & Binary Previews
Inspect the underlying bytes to understand exactly what the encoding produces.
Live, Offline, Private
Auto-debounced live mode runs entirely in your browser with zero uploads.
How to Use Base64 Encoder & Decoder
Get from zero to done in four quick steps — no account, no learning curve.
Paste or type your text
Enter plain text to encode, or a Base64 string to decode. Auto-detect picks the direction.
Use live mode
Toggle live mode to see the result update automatically as you type or edit.
Inspect previews
Open the hex or binary preview to see exactly how your data is being represented.
Copy or download
Copy the result in one click, or download large payloads as a file.
Practical Examples
Real input and output pairs so you know exactly what to expect.
Encode plain text
Input
Hello, World!
Output
SGVsbG8sIFdvcmxkIQ==
Decode Base64
Input
SGVsbG8sIFdvcmxkIQ==
Output
Hello, World!
Unicode survives round-trip
Input
ForgePlug 🚀 ünïcode
Output
Rm9yZ2VQbHVnIPCfppAgw7xu77yRY29kZQ==
Guides & Articles
Learn how to get the most out of this tool with our in-depth guides.
Part of Developer Essentials
Was this tool helpful?
Your feedback helps us improve Base64 Encoder & Decoder for everyone.
Share this tool
