64

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 strings — instantly, in your browser.

base64
// plain text
// base64 output
// output

About Base64 Encoder / Decoder

Base64 is an encoding scheme that converts binary data or text into a safe ASCII string format. It's used throughout web development: embedding images in CSS, encoding credentials in HTTP Basic Auth headers, handling email attachments, and passing binary data through systems that only support text. This tool lets you encode any plain text string to Base64 or decode a Base64 string back to readable text. Everything runs in your browser — no server involved. That makes it safe for encoding sensitive strings like API keys or auth tokens without worrying about data leakage. The encoder handles full UTF-8 input, including emoji, accented characters, and non-Latin scripts. Standard btoa() only handles ASCII, so this tool uses TextEncoder to properly support multi-byte characters before encoding. Common use cases include generating Authorization header values for Basic Auth (base64 of username:password), encoding file contents for data URIs, and decoding JWT payload sections. For JWT decoding specifically, use the JWT Decoder tool — it handles the URL-safe Base64 variant and formats the JSON output for you.

Frequently Asked Questions

What is Base64 encoding used for?
Base64 converts binary or text data into ASCII characters, making it safe to transmit through systems that only handle text. Common uses: HTTP Basic Auth headers (base64 of username:password), data URIs for images in CSS/HTML, email attachments (MIME), and embedding binary data in JSON.
Does Base64 encrypt my data?
No. Base64 is encoding, not encryption — it's fully reversible by anyone. Never use it to hide sensitive data. For security, use proper encryption (AES-256, etc.). Base64 is only for safe text transport, not confidentiality.
Why does my Base64 string end with == signs?
Base64 works in groups of 3 bytes. If the input length isn't divisible by 3, padding characters (=) are added to complete the final group. One = means one padding byte, == means two. This is expected and correct.
What's the difference between Base64 and Base64url?
Standard Base64 uses + and / characters which have special meaning in URLs. Base64url replaces + with - and / with _ to make the string URL-safe. JWTs use Base64url. This tool uses standard Base64 — use the JWT Decoder for JWT-specific decoding.
Why doesn't btoa() work with emoji or accented characters?
btoa() only accepts ASCII (characters 0–127). Multi-byte UTF-8 characters need to be encoded first. This tool uses TextEncoder to convert UTF-8 to bytes before encoding, so emoji, accented letters, and non-Latin scripts all work correctly.