Free online tool

Free Online Base64 Encoder and Decoder

Encode text or files to Base64 and decode Base64 back, with UTF-8 support, URL-safe output, padding control and data addresses. Runs in your browser.

Base64 Encoder and DecoderFree online tool. Runs in your browser.
Live

Base64 is a way of writing binary data, such as a picture or a file, using only 64 safe text characters. It appears in email attachments, web addresses, tokens, configuration files and data embedded in web pages. This tool converts in both directions: text to Base64, Base64 back to text, and files in either direction. It handles accents and emoji properly, supports the URL-safe variant and gives clear messages when the input is not valid Base64.

What Base64 does and does not do

Base64 takes every three bytes of data and writes them as four characters from an alphabet of letters, digits, plus and slash. If the data does not divide evenly, one or two equals signs are added as padding. The result is about a third larger than the original. Most importantly, it is an encoding and not encryption: anyone can reverse it in a second, so it must never be used to hide passwords or private information.

Variant Characters 62 and 63 Padding Typical use
Standard + and / = kept Email, general data
URL-safe – and _ Often removed Web addresses, tokens

How to use it

  1. On the Text tab, choose Encode or Decode and paste your input.
  2. For encoding, pick the standard or URL-safe alphabet, keep or remove padding, and optionally break lines at 64 or 76 characters.
  3. Copy the result, download it, or swap input and result to reverse the step.
  4. On the File tab, choose a file to get its Base64 text or a data address, or paste Base64 and press Save as file to rebuild the file.

Worked examples

The word Hello becomes SGVsbG8= in standard Base64. The text “Hello, wörld! 👋” becomes SGVsbG8sIHfDtnJsZCEg8J+Riw==, because the accented letter and the emoji take several bytes each in UTF-8 and the tool encodes those bytes, not characters. The five characters hi>>? give aGk+Pj8= in the standard alphabet, but aGk-Pj8 in URL-safe form without padding, since the plus sign would otherwise need special treatment in a web address.

Working with files

A file of up to 10 MB can be turned into Base64 or a data address, a text form that begins with data:, the file type and the word base64. Data addresses let a small image sit inside a style sheet or web page without a separate request, though they make the page larger and are best kept for small items. To go the other way, paste Base64 or a data address and press Save as file. The tool looks at the first bytes to recognise common formats such as PNG, JPEG, GIF, WebP, PDF and ZIP, and gives the download a matching extension. The saved file is never opened or displayed by the page.

Helpful error messages

Decoding fails when the input contains characters outside the alphabet, when padding appears in the middle, when the length cannot be right, or when the standard and URL-safe alphabets are mixed. Instead of a vague failure, the tool tells you which character is wrong and where. If the data decodes but is not valid UTF-8 text, you are told that it is probably binary, such as a file, and directed to the File tab.

Common uses

  • Inspecting a token or header copied from a log.
  • Embedding a small icon in HTML or CSS.
  • Preparing data for a field that accepts text only.
  • Checking what an encoded string in a configuration file contains.
  • Recovering a file that was pasted as Base64.

Limits and cautions

Do not paste secrets into any online tool that you do not trust; this one works entirely in your browser and sends nothing, but the habit is worth keeping. Decoded content from unknown sources can be harmful, so do not open files you did not expect. Very large input may slow older phones. The tool follows the standard alphabets from the Base64 specification, and it does not add compression or encryption.

Related tools include the URL encoder and decoder, the JSON formatter and validator, and the password generator for creating real secrets. The guide on what an API is explains where tokens appear, and the cybersecurity course explains why encoding is not protection.

Staying safe with encoded data

Because Base64 hides nothing, treat anything you decode as untrusted until you know where it came from. A string that looks like harmless text can contain a script, and a file saved from Base64 can be an executable in disguise. Look at the detected type before you open anything, scan unexpected files, and never paste tokens or keys from a live system into a place where others could see your screen or history.

Key takeaways

  • Base64 writes binary data as safe text, making it about a third bigger.
  • It is not encryption and gives no secrecy at all.
  • Use the URL-safe variant for web addresses and tokens.
  • Text is encoded as UTF-8, so accents and emoji survive.
  • Files up to 10 MB convert in your browser without upload.

Questions

Is Base64 encryption?

No. Base64 is just a way of writing data in text form, and anyone can decode it instantly without a key. It offers no secrecy. If you need to protect information, use real encryption or keep the data out of places where others can read it, and never rely on Base64 to hide a password.

What is the difference between standard and URL-safe Base64?

Standard Base64 uses plus and slash as its last two characters and equals signs for padding. URL-safe Base64 replaces them with a minus and an underscore, and often drops the padding, so the text can sit in a web address or file name without being altered. Both encode the same data.

Why does my decoded text look wrong?

Common causes are that the original was not UTF-8 text, such as an image or other file, or that the Base64 was damaged when copied. If the data decodes but is not valid text, the tool says so and suggests the File tab. Also check for extra characters or cut-off endings.

How do I convert an image to Base64?

Open the File tab, choose the image, and the Base64 text appears. Choose the data address form if you want a string that starts with data:image and can be placed in an img tag or a style sheet. Keep this for small images, because Base64 is a third larger than the file.

Why does Base64 end with equals signs?

Base64 works on groups of three bytes. When the data ends with fewer than three bytes, one or two equals signs are added so the length is a multiple of four. Some systems accept text without them. The tool lets you keep or remove padding when encoding, and accepts both when decoding.