Base64 encode and decode online for free
Base64 Encode and Decode turns ordinary text into Base64 and back again. Choose a mode, paste your text, and the result appears as you type. It handles accents, Urdu, Arabic and emoji correctly, and has a URL-safe option for use in web addresses and tokens. It is a small but constant helper for developers, testers and anyone who meets a strange-looking string ending in an equals sign. Need to put lines in order next? Sort Lines Alphabetically is the tool for that, and it is free like Base64 Encode and Decode.
How to encode or decode Base64
- Choose Encode text to Base64 or Decode Base64 to text.
- Type or paste your input into the box.
- Tick URL-safe Base64 if you need a string that is safe inside a web address.
- Read the result in the box below. It updates as you type.
- Press Copy result, or use Swap input and output to go the other way.
How does Base64 encoding work?
To encode, the text is first turned into bytes using UTF-8, the standard way of storing text from every language, and then groups of three bytes are written as four characters taken from a set of 64: capital and small letters, digits, plus and slash. If the length is not a multiple of three, equals signs are added at the end as padding. To decode, the steps run backwards. The URL-safe form swaps plus and slash for a dash and an underscore and leaves off the padding, so it can sit in a web address without being altered.
Tips for working with Base64 text
If decoding fails, check for extra characters, a missing piece at the end or a string that is URL-safe while the option is off; this tool accepts both forms when decoding. Remember that Base64 of a file, such as an image, decodes to bytes that are not readable text, and the tool will say so. Never treat Base64 as protection for a secret, because anyone can decode it. Use the swap button to check that a value goes round and comes back the same.
When do you need Base64 encoding?
Base64 appears in data URIs, email attachments, basic authentication headers, tokens and cookies, configuration files and APIs that must carry binary data inside text. People use a tool like this to inspect a header, read a token payload, prepare test data or encode a short text safely.
Who uses Base64 Encode and Decode most?
Developers
Inspect a header, a token part or a configuration value that is stored as Base64.
Testers
Prepare encoded test data and check that text goes round and comes back unchanged.
Curious users
Decode a strange-looking string ending in an equals sign to see what it says.
Things to know before you use Base64
Base64 is an encoding, not encryption. It was designed in the early days of email, when systems could safely carry only plain text characters, to let binary data pass through unharmed. The price is size: the output is about one third longer than the input. Encoding text with accents or non-Latin letters needs one extra step, because the old browser function for Base64 only handles single-byte characters; this tool converts the text to UTF-8 first, so the output matches what other programs produce. The result is the same as you would get in most programming languages that use UTF-8. When decoding, the bytes must form valid UTF-8 text. If they do not, the data is probably a file or a compressed block, and showing it as text would give nonsense. Base64 Encode and Decode pairs well with Remove Line Breaks when you want to join broken lines.
Base64 terms explained
- Base64
- A way of writing bytes with 64 text characters so binary data can travel inside text.
- UTF-8
- The standard way of storing text from all languages as bytes. It is used almost everywhere on the web.
- Padding
- One or two equals signs added at the end of Base64 so its length fits the pattern of four characters per group.
- URL-safe Base64
- A form that uses a dash and underscore instead of plus and slash, so it can be used in web addresses.
Is it safe to use an online Base64 tool?
Everything is converted in your browser. Your text is not uploaded or saved. Even so, avoid pasting real passwords or keys into any website.
Check that Base64 Encode and Decode stays private
After you type or paste some text, press the Privacy check button under the tool. It compares the size of your text with the data this page has sent out, so you can see for yourself that what you typed stayed in your browser. The page may still send small page-view statistics, and the check lists every request it saw. For a second opinion, open your browser developer tools, choose the Network tab and watch it while you use Base64 Encode and Decode.
Continue from Base64 Encode and Decode in another tool
When Base64 Encode and Decode has finished, a Continue panel appears under the tool with the next steps people use most, starting with Sort Lines Alphabetically, then Remove Duplicate Lines, Remove Line Breaks and Case Converter. The result is handed over inside your browser and removed from temporary storage as soon as the next tool receives it.
Created by the ZafarKit team, reviewed by Muzammil Hussain. Last reviewed December 5, 2026.
Found a mistake? Email contact@zafarkit.com and we will fix it.
Base64 encode and decode: frequently asked questions
How do I encode text to Base64?
Choose Encode, then type or paste your text. The Base64 result appears below as you type.
How do I decode a Base64 string?
Choose Decode, paste the string and read the text below. If it is not valid Base64, a message tells you.
Is Base64 encryption?
No. It is only an encoding, and anyone can decode it, so it does not protect secrets.
Does it work with Urdu, Arabic and emoji?
Yes. Text is converted with UTF-8 first, so all languages and emoji are handled correctly.
What does URL-safe Base64 mean?
It uses a dash and underscore in place of plus and slash and drops the equals padding, so it is safe inside web addresses.
Is there a limit on text length?
No fixed limit. Normal text converts at once, and only very large input may slow an older phone.
Can I encode and decode Base64 on my phone?
Yes. It runs in current mobile browsers and updates as you type.
Does the tool send my text anywhere?
No. It is encoded and decoded in your browser. Keep real passwords and keys out of any website anyway.
How can I check that Base64 Encode and Decode does not upload my text?
Use the Privacy check button under the tool. It shows how much data you added and how much the page has sent out, with a list of each request. You can also watch the Network tab in your browser developer tools while Base64 Encode and Decode runs.
Can I use the result of Base64 Encode and Decode in another tool without downloading it first?
Yes. After Base64 Encode and Decode finishes, the Continue panel under the tool lets you open the next tool with the result already loaded, and it never leaves your browser.
What to do after you encode or decode Base64
To convert a picture, use Image to Base64.
To check structured data, try the JSON Formatter.