Encode plain text to Base64 or decode Base64 strings back to text instantly. No data is sent to any server — all encoding and decoding happens locally in your browser.
What is Base64 Encoder / Decoder?
Base64 Encoder / Decoder is a free online tool that converts plain text
into Base64-encoded strings and vice versa. Base64 is a binary-to-text
encoding scheme that represents binary data using a set of 64 ASCII
characters, making it safe for transmission over text-based protocols
like HTTP, SMTP, and JSON. This tool handles the encoding and decoding
process instantly in your browser, with full support for Unicode and
UTF-8 characters. Your data never leaves your device, ensuring complete
privacy.
When to use it?
Use the Base64 tool when you need to embed binary data — such as images,
fonts, or certificates — directly into HTML, CSS, or JSON files. It's
essential when working with APIs that require Base64-encoded payloads,
decoding authentication tokens like JWTs, or preparing data for email
attachments in MIME format. It's also useful for debugging encoded data
you encounter in logs, URLs, or configuration files.
Common use cases
Developers frequently use Base64 encoding to embed small images as data
URIs in HTML and CSS, encode API credentials for HTTP Basic
Authentication headers, encode and decode JWT token payloads for
inspection, prepare file uploads for APIs that accept Base64-encoded
content, and convert binary certificate data into a text-safe format. The
URL-safe variant is used in JWTs and URL parameters where standard Base64
characters (+, /, =) would cause issues.
Step-by-step: How Base64 encoding works
Base64 converts every 3 bytes of input into 4 ASCII characters. First, the bytes are concatenated into a 24-bit binary sequence. This sequence is then split into four 6-bit groups, and each group maps to one of the 64 characters in the Base64 alphabet (A–Z, a–z, 0–9, +, /). If the input length isn't divisible by 3, padding characters (=) are appended to the output. For example, the text "Hi" (2 bytes) produces the 24-bit sequence by adding a zero byte, yielding "SGk=" — the trailing = indicates one byte of padding.
Base64 vs URL encoding vs Hex encoding
| Feature | Base64 | URL Encoding | Hex |
| Size overhead | ~33% | Varies (up to 3×) | 100% |
| URL-safe | No (use URL-safe variant) | Yes | Yes |
| Human readable | No | Partially | No |
| Best for | Binary data in text | Query parameters | Debugging, hashes |
Choose Base64 when embedding binary content like images or certificates in JSON, HTML, or email. Use URL encoding for query string parameters and form data. Use hexadecimal for hash outputs, color codes, and low-level debugging where byte-level inspection is needed.
Base64 in different programming languages
In JavaScript, use btoa() and atob() for basic Latin-1 text, or Buffer.from(text).toString('base64') in Node.js for full UTF-8 support. Python provides the base64 module with b64encode() and b64decode() functions. In Go, use the encoding/base64 package with StdEncoding or URLEncoding variants. Java offers java.util.Base64 with getEncoder() and getDecoder() methods. Each language handles UTF-8 input differently, so always verify the character encoding matches your expected output.