Base64 Encode/Decode
Encode and decode Base64 strings online. Supports text and UTF-8. Free browser-based tool.
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data as ASCII strings. It's commonly used to embed images in HTML/CSS, encode email attachments, and transmit data in URLs and APIs.
Features
- Encode — Convert text to Base64
- Decode — Convert Base64 back to text
- UTF-8 support — Handles Unicode characters correctly
- Privacy — All processing happens in your browser
Tutorial
How to Encode Base64 Online: A Complete Guide
Learn how to encode and decode Base64 strings online in seconds. Step-by-step tutorial with real-world use cases for APIs, images, and email attachments.
Video Tutorial
2:32Video coming soon — full transcript available below
Chapters
Full transcript searchable
What is Base64 and why developers need it
Welcome to this tutorial on Base64 encoding. Base64 is a binary-to-text encoding scheme that converts binary data into ASCII text. It's used whenever you need to transmit binary data over systems that only handle text — like HTTP headers, JSON payloads, XML documents, or email. Common uses include encoding images as data URIs for CSS backgrounds, embedding file attachments in email, passing binary blobs in REST API requests, and storing binary data in JSON. Base64 increases data size by about 33 percent, so it's used for transport, not storage.
Encoding text to Base64
Open the Base64 Encoder on ToolPilot.dev. In the input textarea, type or paste the text you want to encode. Click the Encode button. The Base64-encoded output appears instantly in the output box. You can encode any text including Unicode characters, JSON strings, or plain text. The encoded result uses only characters A-Z, a-z, 0-9, plus, slash, and equals sign for padding. This makes the output safe to include in URLs, HTML attributes, and JSON values.
Decoding Base64 back to text
To decode, paste a Base64 string into the input field and click Decode. The original text appears in the output. This is useful when you receive Base64-encoded data from an API response or auth token. Note that Base64 is an encoding, not encryption — anyone can decode it, so never use it for security. Common Base64-encoded values you might decode include Basic Auth headers (where username:password is encoded), JWT payload sections, and data URIs.
Use case: embedding images in HTML/CSS
One popular use case is embedding small images directly in HTML or CSS using data URIs. Instead of linking to an external image file, you encode the image bytes as Base64 and embed them inline. This eliminates an HTTP request. For example: background-image: url('data:image/png;base64,iVBORw0KGgo...') — the long string after the comma is the Base64-encoded PNG. The Image to Base64 tool on ToolPilot.dev is specialized for this use case and handles image files directly.
Use case: API authentication headers
HTTP Basic Authentication encodes credentials as Base64. When you call an API with basic auth, the Authorization header looks like: Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= — where the value is Base64 of username:password. You can use this tool to decode such headers when debugging API calls, or to generate the header value manually for testing. Just encode your credentials in username:password format.
Privacy & wrap-up
All encoding and decoding happens locally in your browser — no data is sent to any server. This is important since you might encode sensitive strings like API keys or passwords for debugging. The tool uses the built-in browser atob() and btoa() functions for standard Base64, and handles Unicode correctly using TextEncoder. Visit ToolPilot.dev for this tool and 19 other free developer utilities.
Transcript covers all 6 chapters (2:32 total).
Benchmark
Fastest Base64 Encoder Comparison 2026
We tested this tool vs base64.guru, base64encode.org, and CyberChef — 1,000 iterations, Unicode edge cases, privacy analysis.