Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to readable text. Full UTF-8 support, URL-safe output and tolerant decoding.
Runs in your browser. Nothing is uploaded.
About the Base64 Encode / Decode
Base64 represents any data using 64 safe characters (A–Z, a–z, 0–9, + and /), so it can travel through systems that only handle text. You meet it in email attachments, data: URLs, HTTP Basic authentication headers, JSON Web Tokens and many API payloads.
Encoding makes data about a third larger, so it is about compatibility, not compression or security. This tool encodes and decodes text as UTF-8, so accented letters, non-Latin scripts and emoji round-trip correctly. The URL-safe variant swaps + and / for - and _, which is what tokens and URL parameters use.
How to use the Base64 Encode / Decode
- 1
Paste text into the input panel or open a text file. Pasted text is encoded immediately.
- 2
Press Encode to turn text into Base64, or Decode to turn Base64 back into text.
- 3
Turn on URL-safe to use - and _ instead of + and /, without = padding, for tokens and URLs.
- 4
Turn on Wrap at 76 to break long output into lines, as email (MIME) and PEM files expect.
- 5
Use the swap button to feed the output back in, for example to check that decoding returns your original text.
Examples
Grüße 👋R3LDvMOfZSDwn5GLuser:passworddXNlcjpwYXNzd29yZA==Good to know
- This page works with text. Decoding Base64 that holds a binary file (an image, a PDF) reports that the result is not text instead of showing garbled characters.
- Text is encoded as UTF-8, which is what the web, JSON and most APIs expect. Legacy encodings such as Windows-1252 are not offered.
- Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide passwords or secrets.
Frequently asked questions
What is Base64 used for?
Base64 turns any data into 64 safe ASCII characters so it can travel through systems built for text: email attachments, data: URLs, JSON payloads, HTTP Basic authentication headers and JWTs.
What does URL-safe Base64 change?
It replaces + with - and / with _, and drops the = padding, so the result can sit in a URL or filename without escaping. Decoding accepts both forms automatically.
Why is my Base64 string longer than the original?
Every 3 bytes become 4 characters, so Base64 is about 33% larger than the data it encodes. Characters outside ASCII take 2 to 4 bytes in UTF-8, which adds more.
Why does decoding fail?
The input contains a character that is not part of Base64, padding in the middle, or a length that cannot be valid. Spaces and line breaks are ignored, so wrapped input is fine.
Is my code uploaded to a server?
No. Processing happens entirely in your browser, in a background thread. Your input is never sent to our servers or stored anywhere.
Related tools
More tools that pair well with this one.