Base64 Encoder
Encode any text to Base64 instantly online. Free Base64 encoder with full UTF-8 and Unicode support. No signup required.
Related Tools
Base64 Decode
Decode Base64 strings back to plain text instantly. Full UTF-8 support, runs entirely in your browser.
URL Encode
URL-encode any text instantly with percent-encoding. Supports Unicode and all special characters.
URL Decode
Decode URL-encoded percent sequences back to plain text instantly. Supports all encoded characters.
Base64 is a binary-to-text encoding scheme standardized in RFC 4648 that represents arbitrary binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It was designed to safely transmit binary content over channels that only support text, such as SMTP email, which predates modern binary-safe protocols.
Base64 is ubiquitous in modern systems: HTTP Basic Authentication headers, JWT tokens, CSS data URIs for inline images, PEM-encoded TLS certificates, and XML/JSON payloads embedding binary attachments all rely on Base64 encoding. It adds roughly 33% size overhead in exchange for universal text compatibility.
This tool encodes text to Base64 in the browser using the TextEncoder API (converts the input string to UTF-8 bytes first) followed by btoa(). The UTF-8 pre-processing step ensures non-ASCII characters — emoji, accented letters, CJK characters — encode correctly, avoiding the btoa() Unicode limitation.
Common Use Cases
Embedding images in CSS
When bundling small icons or background images into a CSS stylesheet, designers encode the raw PNG or SVG bytes as Base64 and embed them as data URIs (data:image/png;base64,...). This eliminates extra HTTP requests for small assets. Tools like webpack's url-loader do this automatically for files under a configurable size threshold.
HTTP Basic Auth headers
The HTTP Basic Authentication scheme requires credentials formatted as Base64(username:password) inside the Authorization header. When manually crafting API requests — for example, testing a Jenkins or Nexus Repository API with curl — you need to encode the credential pair before inserting it into the header string.
Encoding binary in JSON payloads
REST APIs and GraphQL mutations that accept file uploads via JSON (rather than multipart/form-data) require binary content encoded as Base64 strings. AWS Lambda function invocations, SendGrid email attachments, and Twilio MMS payloads all use this pattern to embed file bytes inside a JSON body.
Storing binary data in environment variables
CI/CD pipelines (GitHub Actions, GitLab CI, CircleCI) store secrets like service account JSON files, TLS private keys, and signing certificates as Base64 strings in environment variables. The raw binary or JSON with special characters would break shell parsing; the Base64 form is a safe single-line string.
How to Use the Base64 Encoder
- Paste or type any text in the left panel.
- The Base64-encoded output appears instantly in the right panel.
- Click "Copy Output" to copy the result to your clipboard.
- Use "Load Example" to see a sample encoding.
- Click "Clear" to reset both panels.
What is Base64?
- Base64 encodes binary data as ASCII text using 64 printable characters.
- Commonly used to embed images, fonts, or files in HTML and CSS.
- Used in JWT tokens, email attachments (MIME), and data URIs.
- Full UTF-8 support — encodes any Unicode text correctly.