Text to Base64 encoder
Encode text to Base64 in your browser: nothing is uploaded, there is no limit on how much you encode, and accents and emoji are encoded as UTF-8 so they decode back exactly as they were.
How it works
-
Paste your code
Paste the code in the left box or open a file. No code to hand? Click Example.
-
Instant result
The result appears as you type. If there is an error, you see the line and character.
-
Copy or download
Copy the result with one click or save it as a file for your editor or project.
What is Base64?
Base64 writes any data with only letters, digits, + and /. That makes it safe to put text in e-mail, JSON, a data URI or an HTTP header (for example Basic authentication). It is not encryption: anyone can turn it back.
URL-safe Base64
With URL-safe, + and / become - and _ and the = padding is dropped. This variant, called base64url, is used in JWT tokens and in links. Wrap at 76 characters adds the line breaks that e-mail (MIME) expects.
Decoding
To turn Base64 back into text, use Base64 decode. Want to see what is inside a token? Try the JWT decoder.
Typical uses
- HTTP Basic authentication: encode
username:passwordand send it asAuthorization: Basic <result>. Remember that this is not protection by itself; always use HTTPS. - Data URIs and small inline assets in HTML or CSS. For whole files, use file to Base64.
- Config files and environment variables that need text without line breaks or special characters.
- JWT-like tokens, using the URL-safe form.
What it costs in size
Base64 turns every 3 bytes into 4 characters, so the output is about 33% larger than the input. That is acceptable for credentials or a short value, but a poor choice for sending large data through an API when a binary upload is possible.
Do not mistake it for encryption
Anyone can decode Base64 in a second with Base64 decode. Never use it to hide passwords or personal data.
Frequently asked questions
Is Base64 a form of encryption?
No. It only changes how data is written. Anyone can decode it, so it gives no protection.
When do I need the URL-safe option?
When the result goes in a link, a file name or a JWT, because + and / have a special meaning there. URL-safe uses - and _ and leaves out the = padding.
Why does my text with accents encode differently from another tool?
Some tools use Latin-1 instead of UTF-8. This tool always uses UTF-8, which is the standard for the web and most APIs.
Is my text uploaded?
No. It is encoded in your browser and never sent anywhere.