Base64 Encoder & Decoder
Encode plain text to Base64 or decode Base64 strings back to text. Supports UTF-8. Runs entirely in your browser.
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 printable ASCII characters. The name "Base64" comes from the fact that 64 characters are used: the uppercase letters A–Z, lowercase letters a–z, digits 0–9, plus (+) and slash (/), with equals (=) used for padding.
Every 3 bytes of binary input are encoded into 4 Base64 characters, making the output about 33% larger than the original. Despite the size overhead, Base64 is invaluable when you need to pass binary data through a text-only medium.
Common Use Cases
- Data URIs — Embed images or fonts directly in HTML/CSS without a separate file request:
src="data:image/png;base64,..." - HTTP Basic Auth — Credentials are Base64-encoded in the
Authorizationheader. - Email attachments — MIME encodes binary attachments as Base64 for safe transport over SMTP.
- JSON payloads — Pass binary blobs (files, images) inside JSON without escaping issues.
- JWT tokens — The header and payload sections of a JWT are Base64URL-encoded.
How to Use This Tool
- To encode: Type or paste plain text into the left box, then click Encode →. The Base64 result appears on the right.
- To decode: Paste a Base64 string into the right box, then click ← Decode. The decoded text appears on the left.
- Use Swap to exchange the contents of both boxes.
- Click Copy next to either box to copy its contents to your clipboard.
Frequently Asked Questions
- What is Base64?
- Base64 is an encoding scheme that converts binary data into a string of ASCII characters. It represents data using 64 printable characters (A–Z, a–z, 0–9, +, /), making it safe to transmit in text-based formats like JSON, XML, HTML, and email.
- Why is Base64 used?
- Base64 is used whenever binary data needs to be stored or transferred over a medium designed for text. Common use cases include embedding images in CSS or HTML (data URIs), encoding attachments in emails (MIME), storing binary data in JSON payloads, and encoding credentials in HTTP Basic Auth headers.
- How do I encode text to Base64?
- Paste or type your plain text into the left box, then click "Encode →". The Base64-encoded result will appear in the right box.
- How do I decode a Base64 string?
- Paste your Base64 string into the right box, then click "← Decode". The decoded plain text will appear in the left box.
- Does Base64 encode encrypt my data?
- No. Base64 is an encoding scheme, not encryption. Anyone with the Base64 string can instantly decode it back to the original data. Do not use Base64 to secure sensitive information.
- Is my data safe?
- Yes. This tool runs entirely in your browser using the built-in btoa() and atob() JavaScript APIs. No data is sent to any server.