How to use the Base64 encoder and decoder
- Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
- Type or paste into the left box; the result updates as you type.
- Enable URL-safe to use the Base64URL alphabet without padding.
- To embed an image or font in CSS or HTML, pick a file and copy the generated data URI.
Common uses of Base64
- Embedding small images in HTML or CSS as
data:URIs - HTTP Basic authentication headers (
Authorization: Basic …) - Email attachments (MIME)
- Storing binary data in JSON or environment variables
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding that represents binary data with 64 printable characters. Anyone can decode it, so it offers no security.
Why does my decoded text look garbled in other tools?
Many tools use the browser function btoa, which only handles Latin-1 characters. This tool encodes text as UTF-8 first, so accents, emoji and non-Latin scripts round-trip correctly.
What is URL-safe Base64?
Standard Base64 uses + and /, which have special meaning in URLs. The URL-safe variant (Base64URL) replaces them with - and _ and usually drops the trailing = padding. JWTs use it.
Why is the Base64 output bigger than the input?
Base64 turns every 3 bytes into 4 characters, so encoded data is about 33% larger than the original.