Base64 Encoder & Decoder
Free Base64 encoder/decoder. Convert text and images to/from Base64. Fast, secure, client-side processing. No signup needed.
About This Tool
Base64 Encoder/Decoder converts text or binary data to and from Base64 encoding directly in your browser. It supports standard Base64 (RFC 4648) and URL-safe Base64 variants. Perfect for developers working with APIs, email attachments (MIME), data URIs, or JWT tokens.
How It Works
Base64 encoding converts binary data into a set of 64 printable ASCII characters (A-Z, a-z, 0-9, +, /), plus '=' for padding. The algorithm takes the input byte stream and processes it in 3-byte (24-bit) groups. Each 24-bit group is split into four 6-bit segments, and each segment maps to one of the 64 characters in the Base64 alphabet.
If the input length is not a multiple of 3, the encoder pads the final group with zero bits and appends one or two '=' characters to signal the padding. This ensures the encoded output length is always a multiple of 4 characters. Decoding reverses this process: each Base64 character is mapped back to its 6-bit value, the bits are concatenated, and the original byte stream is reconstructed. URL-safe Base64 replaces '+' with '-' and '/' with '_' to avoid conflicts in URLs and filenames.
How to Use
- 1Choose Text ↔ Base64 or Image ↔ Base64 tab.
- 2Text tab: Select encode/decode direction and enter your text or Base64 string.
- 3Image tab: Drag & drop an image, or paste a Base64 string to preview.
- 4Toggle URL-safe to get JWT-compatible or URL-parameter-safe Base64.
- 5Copy the result or swap input/output for reverse conversion.
Frequently Asked Questions
What is Base64 encoding?
Base64 is an encoding method that converts binary data into ASCII text. It transforms 3 bytes into 4 safe ASCII characters, making it suitable for email, URLs, JSON, and other text-based protocols.
What is URL-safe Base64?
URL-safe Base64 replaces + with - and / with _ from standard Base64. It also removes padding (=). This variant is commonly used in URL parameters, JWT tokens, and API communications.
Why convert images to Base64?
Base64-encoded images can be embedded directly in HTML/CSS (data URIs) or included in API request bodies. This eliminates the need for separate file uploads and reduces HTTP requests.
Is my data sent to a server?
No, all conversions happen in your browser. No data is transmitted to any server. Your text and images never leave your device.
Related Articles
JSON Formatting Best Practices for Developers
Master JSON formatting with these essential best practices. Learn about proper indentation, validation, common mistakes, and tools that make working with JSON easier.
2026-03-01How to Create Strong Passwords That You Can Remember
Learn proven strategies for creating strong, memorable passwords. Understand what makes a password secure and how to manage multiple passwords safely.
2026-02-27Understanding Base64 Encoding: A Beginner's Guide
Learn what Base64 encoding is, how it works, when to use it, and common pitfalls. A practical guide for developers working with data encoding.