base64 encode decode online

Convert text or files to Base64 and decode Base64 back to text, images or files, right in your browser.

This free Base64 Encode / Decode tool turns any text or file into a safe string of letters and numbers, and turns it back again. It helps developers, bloggers and website owners who need to embed small images, read API data or check a token without installing anything.

Features

Text, files and images

Encode typed text or any file, including images, and decode Base64 back to text, an image preview or a downloadable file.

Correct Unicode handling

Text is converted as UTF-8 first, so accented letters, Hindi and emoji survive the round trip without errors.

Standard and URL-safe alphabets

Choose the standard alphabet or the URL-safe one, keep or remove the = padding, and wrap lines at 64 or 76 characters.

Data URI output

Add the data: prefix in one click, ready to paste into HTML or CSS. Decoding also accepts data URIs.

How to Use

  1. Pick Encode to Base64 or Decode from Base64 at the top.
  2. Type or paste your text, or press Open file to load an image or other file.
  3. When encoding, choose the alphabet, padding, line breaks and data URI option you need.
  4. Press Convert. The size of the result is shown under the boxes, and an error message appears if the input is not valid.
  5. Copy the result or download it. Decoded images show a preview, and binary results are saved with the right file extension.

Use Cases

Small images inside HTML or CSS

Turn a tiny icon into a data URI so it loads with the page and needs no extra request.

Reading API and config values

Decode Base64 fields from API responses, configuration files or email headers to see what they contain.

Basic Authentication headers

Encode a username and password pair to understand or test the Authorization header format.

Binary data in JSON

Wrap a small file as text so it can travel inside a JSON body, then decode it at the other end.

Basic Knowledge

Base64 is a way to write binary data using only 64 safe characters: A to Z, a to z, 0 to 9, plus and slash. It was designed so that data such as images or files can pass through systems made for plain text, like email or JSON, without being damaged.

It works on groups of three bytes. Those 24 bits are split into four groups of six bits, and each group picks one character from the alphabet. When the input does not divide evenly into threes, one or two equals signs are added as padding. Because four characters replace three bytes, the output is about one third larger than the input.

The URL-safe version swaps plus and slash for hyphen and underscore, and often drops the padding, so the text can sit inside a web address. Tokens such as JWTs use this form.

Base64 encodes bytes, not letters, so any Base64 Encode / Decode tool must turn text into bytes first, normally with UTF-8. Most important, Base64 is an encoding and not encryption. Anyone can decode it, so it must never be used to hide a password.

Tips and Common Mistakes

  • Do not treat Base64 as security. It only changes the format, and anyone can reverse it in seconds.
  • If decoding fails, check for missing characters, extra quotes, or a mix of standard and URL-safe characters.
  • Use data URIs only for small files. A large image encoded inline makes the page heavier than a normal image file.
  • If two tools give different output for the same input, compare the alphabet, padding and line break settings first.

Safety and Privacy

  • Encoding and decoding run in your browser with JavaScript, so the text and files you use are processed on your own device and are not uploaded by this tool.
  • Nothing is stored. Your input and output disappear when you reload or close the page.
  • The page is served over HTTPS, so the connection between your browser and ranktools.in is encrypted.
  • The tool does not share your data with third parties. Because Base64 is not encryption, avoid pasting live passwords or private keys on a shared computer.

Frequently Asked Questions

What is Base64 used for?

It lets binary data travel through systems that only handle text, such as email, JSON and HTML. Common examples are inline images, Basic Authentication headers and tokens.

Is Base64 encryption?

No. It is a reversible format change with no key, so anyone can decode it. If you need to keep data secret, use real encryption instead.

Why is the Base64 output longer than the input?

Every three bytes become four characters, so the result is about 33% larger. Line breaks and padding add a little more.

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

The standard version uses plus and slash. The URL-safe version uses hyphen and underscore so the text is safe in web addresses, and it often leaves out the equals padding.

Can this Base64 Encode / Decode tool handle images?

Yes. Open an image file to get its Base64 or a data URI, or paste Base64 of a PNG, JPG, GIF or WebP to see a preview and download the file. Files up to 10 MB are supported.

Related Tools