Base64 encode and decode
Convert text to Base64 and Base64 back to text, right in your browser.
This Base64 tool converts plain text to Base64 and decodes Base64 back to text. Paste your text and press Encode to Base64, or paste an encoded string and press Decode from Base64. Everything runs in your browser, so even long or sensitive strings never leave your machine.
Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.
How to use it
- Paste your text or your Base64 string into the box.
- Press Encode to Base64, or Decode from Base64.
- The result replaces the text; press Copy or Download .txt to keep it.
What this tool does
Base64 is a way of writing any data — text, but also images, keys or files — using only 64 safe characters: A–Z, a–z, 0–9, plus + and /, with = as padding at the end. It is not encryption and it is not compression. Its whole job is to survive systems that only expect plain text, without a stray byte getting mangled along the way.
Encoding takes every three bytes of your input (24 bits) and rewrites them as four Base64 characters (4 × 6 bits). That is why Base64 output is always about a third larger than the input, and why the length is always a multiple of four — the trailing = signs pad the last group when the input does not divide evenly.
This encoder is UTF-8 safe. Emoji, accented letters and non-Latin scripts are turned into their UTF-8 bytes first and then encoded, so decoding gives you back exactly what you typed rather than a row of question marks.
Examples
A few round trips, so you can see the shape of the output:
| Text | Base64 |
|---|---|
| Hi | SGk= |
| TextFizz | VGV4dEZpeno= |
| café | Y2Fmw6k= |
Notice that café encodes to more characters than its four letters suggest — the accented é is two UTF-8 bytes, and Base64 counts bytes, not letters. Decoding VGV4dEZpeno= returns TextFizz unchanged.
When you need it
Base64 shows up wherever text-only channels have to carry data that is not plain text:
- Reading or building a data URI such as
data:image/png;base64,…for an inline image or icon. - Inspecting the payload of a JWT (JSON Web Token) — its three dot-separated parts are Base64url.
- Decoding an email attachment or a MIME block that was transmitted as Base64.
- Pasting a certificate, key or config value that a tool handed you in Base64.
- Embedding a small binary blob in JSON, YAML or an environment variable that only accepts text.
Because it is reversible by anyone, Base64 is a transport format, not a security measure — see the FAQ below.
Base64 vs Base64url
Standard Base64 uses + and /, which are unsafe in URLs and file names — a / looks like a path separator and a + can be read as a space. Base64url is a small variant that swaps + for - and / for _, and often drops the = padding. It is what you see in JWTs and in many web APIs.
This tool produces and reads standard Base64. If you are decoding a JWT or a URL-safe token, replace - with + and _ with / first, and the string will decode cleanly.
Doing it without this tool
Command line (Linux/macOS): echo -n 'TextFizz' | base64 to encode, and echo 'VGV4dEZpeno=' | base64 -d to decode.
Browser console: btoa('Hi') and atob('SGk=') — but note the built-in btoa breaks on non-Latin characters, which is exactly the case this page handles for you.
Python: import base64; base64.b64encode(b'TextFizz') and base64.b64decode('VGV4dEZpeno=').
PowerShell: [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes('TextFizz')).
Privacy: your text never leaves your browser
The encoder and decoder are a few lines of JavaScript that run on your device. No text is uploaded, nothing is logged, and the page keeps working offline once it has loaded.
That matters here more than on most tools: Base64 often carries tokens, keys and config values. Because the conversion happens locally, you can paste that kind of string without it ever touching a server.
Related tools
Frequently asked questions
No. Anyone can decode Base64 in seconds — it hides nothing. It is a way to represent data as safe text, not a way to keep it secret. Never use it to protect passwords or private data.
Base64 rewrites every three bytes as four characters, so the output is about 33% larger. The trailing = signs pad the final group.
Yes. Text is converted to UTF-8 bytes before encoding, so emoji, accents and non-Latin scripts survive a full encode-then-decode round trip.
Common causes are missing = padding, stray spaces or line breaks, or a Base64url string using - and _. Replace - with + and _ with /, remove whitespace, and try again.
It is padding. Base64 works in groups of four characters; when the input does not divide evenly, one or two = signs fill the last group.
You can decode each part after splitting on the dots, but JWTs use Base64url — swap - for + and _ for / first. The signature part is not meant to be human-readable.
Only your browser memory. Everything runs locally, so there is no upload limit, but very large inputs will use more RAM.