Base64 Encode & Decode
Encode text to Base64 or decode Base64 strings back to text. Supports file uploads for encoding.
0 characters
Introduction
Base64 encoding converts binary data into a safe ASCII string that can travel through text-only channels — email bodies, JSON payloads, URL query parameters, and XML documents all require content to be printable characters. Whether you are embedding a font in a CSS file, passing a binary token in an HTTP header, or storing an encrypted payload in a database text column, a Base64 encoder/decoder is the essential bridge between binary and text worlds.
What Is Base64 Tool?
A Base64 tool is a bidirectional encoder and decoder that transforms text or binary data to and from Base64 representation. Encoding converts each group of three input bytes into four ASCII characters from the Base64 alphabet (A-Z, a-z, 0-9, +, /), with = padding characters appended when the input length is not a multiple of three. Decoding reverses the process, reconstructing the original bytes from the Base64 string.
The tool supports the three Base64 variants used in different contexts. Standard Base64 (RFC 4648) uses + and / as the 62nd and 63rd alphabet characters. URL-safe Base64 replaces these with - and _ so the encoded string can be embedded in URLs without percent-encoding. The "no padding" variant strips the trailing = characters, which many web APIs prefer for cleaner-looking tokens. The tool lets you select the appropriate variant and converts between them.
Beyond simple text encoding, the tool handles file encoding where you upload a binary file (PDF, ZIP, image) and get its Base64 representation. It also supports decoding Base64 strings back into downloadable files — paste a Base64-encoded PDF and download the decoded binary. This is invaluable for debugging API responses that return binary data as Base64, or for extracting files embedded in data URIs.
Base64 Tool Examples
| Input | Output |
|---|---|
| Encode: "Hello, World!" | SGVsbG8sIFdvcmxkIQ== |
| Decode: "TWFuIGlzIGRpc3Rpbmd1aXNoZWQ=" | Man is distinguished |
| URL-safe encode: {"user":1} | eyJ1c2VyIjoxfQ (no +, /, or = characters) |
Key Features of Base64 Tool
- Bidirectional encoding and decoding between plain text and Base64 in a single interface
- Three Base64 variants: standard (RFC 4648), URL-safe (- and _), and no-padding mode
- File encoding: upload any binary file and get its Base64 string representation
- File decoding: paste a Base64 string and download the decoded binary file with the correct extension
- Live encoding that updates the output as you type, with character and byte size indicators
- Line-wrapping option at 76 characters for MIME-compliant Base64 used in email attachments
- Auto-detection of the Base64 variant from the input string's character set for hassle-free decoding
Having encoding, decoding, and variant conversion in a single interface eliminates the context-switching that comes from juggling separate tools or command-line invocations every time you need to inspect a JWT token, debug a data-URI in a CSS file, or decode an API response that returned binary content as a Base64 string. The three variant options — standard, URL-safe, and no-padding — cover every specification you will encounter in practice, from MIME email attachments that require 76-character line wrapping to JWT payloads that mandate the URL-safe alphabet. File encoding and decoding turn the tool into a lightweight binary transport utility: paste a Base64-encoded PDF received in a webhook payload and download the file, or upload a font and copy the resulting string straight into a CSS src declaration. Live encoding with character and byte-size indicators helps you catch input errors as you type rather than discovering them after pasting malformed Base64 into a production system. This is the kind of utility that sits in your bookmarks and gets used daily, whether you are a backend engineer debugging API integrations or a frontend developer embedding assets inline.
How It Works
Enter Your Text or Base64 String
Type or paste the plain text you want to encode into Base64, or paste an existing Base64 string you want to decode back to readable text. The tool automatically detects the direction based on whether your input looks like encoded or plain content.
Instant Encoding or Decoding
The tool applies the Base64 algorithm to convert your text into a safe ASCII string for encoding, or reverses the process to recover the original text for decoding. All conversion happens in your browser with no server round-trip, producing results in milliseconds even for long strings.
Copy the Converted Output
The encoded or decoded result appears immediately in the output area. Copy it with one click for use in data URIs, API payloads, email attachments, or any context where binary data needs to travel safely through text-only channels.
Who Uses This
Web Developers
encoding images and fonts as Base64 data URIs to embed them directly in CSS or HTML, reducing HTTP requests for small assets that benefit from inline embedding
API Integrators
encoding authentication credentials and binary payloads in Base64 for HTTP Basic Auth headers and multipart form data that require text-safe representation of binary content
Email Engineers
decoding Base64-encoded MIME attachments from raw email source to verify that attachments are correctly encoded before sending through SMTP relay systems
Related Tools
URL Encoder/Decoder
Percent-encode or decode URL special characters
Try itUtilityHTML Entity Encoder
Encode or decode HTML entities for safe embedding
Try itUtilityJWT Decoder
Decode JSON Web Tokens into readable header and payload
Try itUtilityImage to Base64
Encode images as Base64 data URIs for inline embedding
Try it