Base64 Encoder
Base64 encoder for the browser. Encode UTF-8 text to standard or URL-safe Base64, with optional line wrapping. Uses the browser's native btoa after UTF-8 encoding — no upload.
Text in, Base64 out
Base64 expands input by roughly 33% — every 3 bytes of input become 4 characters of output. Unicode multiplies first via UTF-8.
Hello, world!
SGVsbG8sIHdvcmxkIQ==
What you'll use this for
Base64 is the lingua franca of "binary over text" channels — embed bytes inside JSON, HTTP, URLs, email, or environment variables.
HTTP basic auth
Encode user:password for an Authorization header without writing code.
Data URIs
Embed small images directly in CSS or HTML via data:image/png;base64,....
Email attachments
MIME wraps binary attachments in Base64 with 76-char lines — toggle that here.
Kubernetes secrets
Encode values for kubectl create secret manifests directly.
How to Base64-encode text
Paste your text
Drop it into the left editor. Unicode is fine — it's UTF-8 encoded first, then Base64 wraps the bytes.
Pick variant
Standard for most uses. URL-safe (- and _ instead of + and /) for JWTs and URLs.
Click Encode
Or leave auto-encode on for live updates. Runs locally — no upload.
Copy or download
Copy to clipboard or save as .txt. Or jump straight to the decoder for round-trip checks.
Frequently asked questions
No. Base64 is a binary-to-text encoding for safe transport in text-only channels (HTTP headers, JSON, email). It is fully reversible without a key. Anyone with the Base64 string can decode it.
Yes. Input is encoded as UTF-8 first via TextEncoder, then those bytes go through Base64. Round-tripping back through the decoder reproduces the original Unicode string.
RFC 4648 §5 replaces + with - and / with _, so the output is safe in URLs and filenames. JWTs use this variant. Toggle it under Variant.
Base64 maps every 3 input bytes to 4 output characters — a ~33% size increase. Plus optional padding (=) to round to multiples of 4.
Yes. No signup, no limits, no ads. Runs entirely in your browser.
About Base64 encoding
Base64 (RFC 4648) is a binary-to-text encoding that uses 64 printable ASCII characters: A-Z, a-z, 0-9, plus + and / (or - and _ for the URL-safe variant). It's used wherever raw bytes need to ride through text-only channels.
How encoding works
- Each 3 input bytes (24 bits) become 4 output characters (4 × 6 bits).
- If the input length isn't a multiple of 3, padding
=(or==) is appended. - Unicode strings are UTF-8 encoded first, then the byte stream is Base64'd.
When to use which variant
- Standard — HTTP headers, email (MIME), most APIs.
- URL-safe — JWTs, query strings, file names, anywhere
+//would conflict. - No padding — JWTs strip
=for compactness; some APIs require it.