Base64 Encoder and Decoder
Turn text into Base64 or turn Base64 back into text. Accented letters, emoji and other scripts are handled correctly because the text is converted to UTF-8 first. You can produce the URL-safe form, break long output into lines, and decode data that was written either way.
- Free
- No sign-up
- Runs in your browser
- Nothing uploaded
Encode or decode Base64
Text is converted to UTF-8 first, so accents, emoji and other scripts work.
Uses - and _ instead of + and /, and leaves off the = padding.
The MIME e-mail convention. Most other uses want one long line.
How to use it
Choose encode or decode
Select “Encode text to Base64” to convert plain text, or “Decode Base64 to text” to read Base64 you have been given.
Paste your input
Type or paste into the first box. When decoding, spaces, line breaks and a leading data: URL prefix are ignored.
Set options
When encoding, tick URL-safe Base64 for the - and _ alphabet without padding, or line breaks at 76 characters for the e-mail convention.
Copy the result
Copy it or download it. “Use result as input and switch” lets you check a round trip.
Example: reading a Base64 value from a configuration file
A configuration file contains the value SGVsbG8sIHdvcmxkIQ==. Choose Decode, paste it, and the result reads “Hello, world!”. If the decoded bytes are not text, for instance because the value is an image, the tool says so, shows the first bytes and offers the raw data as a download instead of printing nonsense.
Standard and URL-safe Base64
Both forms encode the same bytes. They differ in two characters and in padding.
| Form | Characters 62 and 63 | Padding | Typical use |
|---|---|---|---|
| Standard | + and / | = added so the length is a multiple of 4 | E-mail, data: URLs, many APIs |
| URL-safe | - and _ | Usually left off | Web tokens, file names, values inside URLs |
Limits and limitations
- Base64 is an encoding, not encryption. Anyone can decode it, so it does not protect secrets.
- Base64 makes data about one third larger.
- This tool encodes text. It does not read files, so images and other binary files cannot be converted to Base64 here.
- When decoding, the result is shown as text only if the bytes are valid UTF-8. Text saved in another encoding can appear as binary data.
- Missing = padding is accepted when decoding, with a note. Mixed standard and URL-safe characters are rejected.
Frequently asked questions
Is my text uploaded?
No. Your text is processed by JavaScript running in your browser and is not sent to a server. The page itself still loads from a web server like any website. This site can load advertising or analytics scripts, but only after you accept them in the cookie notice. They are separate from the tools, which never pass the files or text you work with to them.
Why does decoding say my data is not text?
Base64 can carry any bytes. If the decoded bytes are not valid UTF-8 text, the data is probably a file such as an image or a compressed archive. You can download the raw bytes.
What is the difference between standard and URL-safe Base64?
Standard Base64 uses + and /, which have special meanings in URLs. The URL-safe form swaps them for - and _ and normally omits the = padding. The decoder accepts either.
Why does the encoded text end with = signs?
Base64 works in groups of three bytes. When the data does not fill the last group, one or two = signs pad the output to a multiple of four characters.
More tools
- JSON Formatter & ValidatorValidate JSON with exact error locations, then format, minify or sort it.Developer tools
- URL Encoder & DecoderPercent-encode or decode text, query values and whole URLs.Developer tools
- QR Code GeneratorTurn a link or text into a QR code and download it as a PNG or SVG.Developer tools