Base64 Encode
Encode text to Base64
SGVsbG8sIPCfjI0hIENhZsOpIG5hw692ZSBmYcOnYWRlLg==
What is Base64 Encode?
Encode any UTF-8 text to Base64, with standard or URL-safe alphabet options. The standard alphabet uses + and / with = padding; URL-safe uses - and _ and drops padding, so the output is safe inside a URL path or query string without percent-encoding. Handles Unicode and emoji correctly — no surprising mojibake when round-tripping non-ASCII text.
How do I use Base64 Encode?
- Paste text into the input panel.
- Choose Standard or URL-safe.
- Copy the encoded output.
Base64 Encode by the numbers
- Alphabets
- Standard + URL-safe
- Padding
- Configurable (on / off)
- Input types
- Text, file upload, raw bytes
- Max file
- 100 MB
- Character encoding
- UTF-8 (default), ASCII
Common use cases for Base64 Encode
- Embedding a small PNG icon directly in a CSS data-URI.
- Encoding a JWT payload for a manual test request.
- Preparing a certificate blob to paste into Kubernetes secrets.
- Including binary bytes inside a JSON API payload.
- Producing URL-safe tokens from random bytes.
Common pitfalls and how to avoid them
- URL breaks because of + or / — Toggle "URL-safe" output. It swaps + for - and / for _ and drops padding.
- Emoji and accents get garbled — Ensure UTF-8 encoding is enabled — non-ASCII characters must be UTF-8 encoded before base64.
- Output is longer than the input — Normal — base64 adds ~33% overhead. If size matters, gzip first, then base64.
When should I use Base64 Encode?
Base64 Encode is for short strings and credentials. To decode Base64 back to text, use Base64 Decode. For encoding an image file as a data URI, use Image to Base64, which handles binary input directly.
What is base64 encoding?
A binary-to-text encoding that represents any bytes using 64 safe ASCII characters. Used for embedding images in HTML, encoding binary data in JSON, email attachments, and API payloads.
Does it support UTF-8 text?
Yes. Non-ASCII characters (emoji, CJK, accents) are encoded as UTF-8 bytes first, then base64 — round-trips perfectly.
URL-safe or standard base64?
Toggle "URL-safe" to use - and _ instead of + and /, and to strip padding = characters. Required for JWT and URL parameters.
Is my file uploaded anywhere?
No. Everything runs in your browser. Your files never leave your device, and there is no server component for this tool.