Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 back to text instantly. Handles any language and emoji, supports the URL-safe variant, and never sends your data anywhere.
Free Online Base64 Encoder and Decoder
Base64 is a way of writing data using only 64 safe characters: the letters A to Z and a to z, the digits 0 to 9, plus + and /. It lets text and binary data travel through systems that only handle plain text, such as email, JSON, XML and URLs. This tool encodes any text to Base64 and decodes Base64 back to text. It works with every language and with emoji, and all of it happens in your browser.
How to Use the Base64 Tool
- Click Encode to turn text into Base64, or Decode to turn Base64 back into text. The labels and buttons change to match.
- Type or paste your input. The result appears as you type, or when you press the Encode or Decode button.
- Tick URL-safe Base64 if the result will be used in a URL, a filename or a token.
- Press Copy Output to copy the result. Swap Input and Output moves the result into the input and switches the mode.
Examples
| Text | Base64 |
|---|---|
| Hello | SGVsbG8= |
| Hello, World! | SGVsbG8sIFdvcmxkIQ== |
| user:pass | dXNlcjpwYXNz |
The = signs at the end are padding. They make the length a multiple of 4 and are removed in the URL-safe form.
Standard and URL-Safe Base64
Standard Base64 uses + and /, which have special meanings in URLs and file names. The URL-safe variant replaces them with - and _ and usually drops the padding. It is used in JSON Web Tokens, URLs and file names. When you decode, this tool accepts both forms automatically.
Common Uses
- HTTP Basic authentication. The username and password are joined with a colon and sent as Base64 in the Authorization header.
- Data URIs. Small images and fonts can be embedded directly in HTML and CSS.
- Email attachments. The MIME standard encodes attachments as Base64 text, usually in 76-character lines.
- JSON and XML. Binary data such as a file or a key can be stored inside a text field.
- Tokens. JWTs and many API keys use URL-safe Base64 for their parts.
Base64 Is Not Encryption
Base64 only changes how data is written. Anyone can decode it in a second, so it gives no protection. Never use it to hide passwords, keys or personal data. If something must stay secret, use real encryption and secure transport. Note also that Base64 makes data about 33% larger.
Troubleshooting Decoding Errors
- Invalid character. Base64 contains only letters, digits,
+,/and trailing=. Remove quotes, commas or other extra characters. - Wrong length. A string with one leftover character was cut off. Make sure you copied all of it.
- Not valid UTF-8 text. The data is binary, such as an image or a PDF, so it cannot be shown as text. For images, use the Image to Base64 tool.
Privacy
Everything runs in your browser. Your text and Base64 strings are not uploaded, stored or logged.
Frequently Asked Questions (FAQ)
Is the Base64 encoder and decoder free?
Yes. It is free, needs no sign-up and has no usage limit.
Is my data sent to a server?
No. The conversion happens in your browser, so your text never leaves your device.
Does it support Unicode, emoji and other languages?
Yes. Text is converted as UTF-8 before encoding, so accented letters, non-Latin scripts and emoji decode back correctly.
Is Base64 the same as encryption?
No. Base64 is only an encoding. Anyone can reverse it, so it must not be used to protect secrets.
Why does the output end with one or two equals signs?
They are padding that makes the length a multiple of 4. URL-safe Base64 normally leaves them out.
Why is the Base64 text longer than my original?
Every 3 bytes of data become 4 characters, so the result is about one third larger.
Can I decode Base64 that has line breaks or spaces?
Yes. Whitespace is ignored when decoding, so multi-line Base64 from emails and certificates works.
