Encode and decode Base64 text and files instantly. URL-safe mode, file support. Free, no signup.
๐ Open Base64 EncoderFree ยท No signup ยท No data stored ยท Instant results
The ToolForge Base64 Encoder and Decoder converts text and binary data to and from Base64 format instantly. Base64 is widely used in web development for encoding images in CSS, encoding credentials in APIs, and transmitting binary data over text-based protocols. Supports standard Base64, URL-safe Base64 and file encoding. All processing happens in your browser โ data is never sent to any server.
Encode text to Base64 instantly
Decode Base64 back to plain text
URL-safe Base64 mode (replaces + and /)
Encode and decode files to Base64
One-click copy for encoded output
Handles Unicode and special characters
Standard and URL-safe encoding modes
Completely client-side โ no data sent to server
Enter the text you want to encode or the Base64 string you want to decode.
Choose Encode or Decode and optionally select URL-safe mode.
Click Copy to save the output to your clipboard.
Encode API credentials, tokens and binary data for HTTP headers and requests.
Convert images to Base64 for embedding in CSS or HTML without separate file requests.
Encode Kubernetes secrets and configuration values for YAML manifests.
Learn about data encoding, binary representation and web protocols in computer science courses.
One of the most frequent uses of Base64 decoding in modern software development is inspecting JSON Web Tokens (JWTs). A JWT consists of three parts separated by periods (`.`): the header, the payload, and the signature.
The header and payload are both encoded using Base64URL format. If you need to debug authorization scopes or user IDs, you can simply copy the middle payload segment of the JWT and paste it into our decoder above (ensuring the URL Safe toggle is checked).
Base64 is a binary-to-text encoding scheme defined in RFC 4648. It translates raw binary data into a web-safe ASCII string representation consisting of 64 characters: A-Z, a-z, 0-9, +, and /.
At the bit level, standard computer bytes represent 8 bits of data. Base64 processes data by taking three 8-bit bytes (3 ร 8 = 24 bits) and dividing them into four 6-bit chunks (4 ร 6 = 24 bits). Each 6-bit numerical value maps directly to an index in the 64-character Base64 alphabet (2โถ = 64).
Because four Base64 characters are required to represent every three raw input bytes, Base64 encoding increases overall payload file size by approximately 33%.
Standard Base64 strings include + and / characters, which carry reserved structural meaning in URL paths and HTTP query parameters. To safely transmit payloads inside URLs, use the Base64URL variant.
| Feature | Standard Base64 (RFC 4648 ยง4) | Base64URL Safe (RFC 4648 ยง5) |
|---|---|---|
| Character 62 | + (Plus sign) | - (Hyphen / Dash) |
| Character 63 | / (Forward slash) | _ (Underscore) |
| Trailing Padding | Mandatory = signs | Omitted or stripped |
| Primary Use Cases | MIME Email, XML, Data URIs | JWTs, HTTP GET Params, OAuth |
Modern web browsers natively support Base64 string manipulation via the btoa() and atob() window methods. However, because these legacy functions only support ASCII characters, passing emojis or UTF-8 strings directly will throw a DOMException error. Use the TextEncoder and Buffer APIs for safe Unicode handling:
// Browser Vanilla JS (Safe UTF-8 Unicode Encoding)
function encodeUTF8ToBase64(text) {
const bytes = new TextEncoder().encode(text);
const binary = Array.from(bytes, (byte) => String.fromCharCode(byte)).join("");
return btoa(binary);
}
// Node.js Backend Implementation
const payload = "Hello, ToolForge! ๐";
const encoded = Buffer.from(payload, "utf-8").toString("base64");
const decoded = Buffer.from(encoded, "base64").toString("utf-8");If you are working in a CI/CD pipeline or a headless Linux server, you can encode files natively using coreutils without writing any code:
# Encode a configuration file and strip newlines
base64 -w 0 config.json > config_b64.txt
# Decode a string directly in the terminal
echo "SGVsbG8gV29ybGQ=" | base64 --decodeBase64 is an encoding scheme that converts binary data into a text string using 64 printable ASCII characters. It is used to transmit binary data over text-based protocols.
No. Base64 is encoding, not encryption. Anyone can decode Base64 instantly โ it provides no security. Use it only for data formatting, not security.
URL-safe Base64 replaces + with - and / with _ to make the encoded string safe for use in URLs without percent-encoding. Used in JWT tokens and OAuth.
Yes. The file encoding feature lets you select a file and get its Base64 representation for use in data URIs or API payloads.
Yes, completely free. All processing happens in your browser โ data is never sent to any server.
Free ยท URL-Safe Mode ยท File Support ยท No Signup
๐ Open Base64 EncoderRelated Guides