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
That One Missing Comma Broke Production: JSON Formatting Guide for 2026
A missing comma in a config file once took down our payment service for 47 minutes. This guide covers every JSON formatting rule that matters — common mistakes, JSON vs YAML comparison, large file handling with jq, and validation workflows that catch errors before they hit production.
2026-03-01Your 8-Character Password Can Be Cracked in 39 Minutes: Password Math for 2026
How long each password length actually takes to crack in 2026 hardware, why passphrases beat symbol-heavy passwords, and how password managers shift the real problem.
2026-02-27Why Your Image Isn't Loading: Understanding Base64 Encoding in 2026
A broken img tag led me down a two-hour rabbit hole that ended with me finally understanding Base64 encoding. This guide covers how Base64 works at the bit level, when to use it versus when it makes things worse, the URL-safe variant, size overhead with real examples, and every use case from JWT tokens to email attachments.