Skip to content
Converter Everyone Free Online Converters
Converter Everyone

Colour mode

↑↓ to choose Enter to open Esc to close

Base64 Encoder and Decoder

Encode text or files to Base64 and decode Base64 back to text or a file, with UTF-8, URL-safe and data URL options.

Runs in your browser Free, no sign-up

Mode

How to encode and decode Base64

  1. To encode text, choose Encode and type or paste it. The Base64 appears as you type, using UTF-8 so accents, Urdu, Arabic, Chinese and emoji all work.
  2. To encode a file, such as an image for HTML or CSS, press Encode a file. Turn on the data: URL prefix if you will paste it into a web page.
  3. To decode, choose Decode and paste the Base64 or data: URL. Spaces, line breaks, missing padding and URL-safe characters are all accepted.
  4. If the result is text you will see it straight away; if it is an image, PDF or other file, you can preview it and download it.

Example

Text and its Base64
TextBase64
HelloSGVsbG8=
Hello, world!SGVsbG8sIHdvcmxkIQ==
caféY2Fmw6k=
✓4pyT

The = signs at the end are padding: they show the last group held one or two bytes instead of three.

Frequently asked questions

What is Base64?

Base64 writes any data, including images and files, using only 64 safe characters: A–Z, a–z, 0–9, + and /. It lets binary data travel through places that only accept text, such as email, JSON, HTML and URLs. It is an encoding, not encryption: anyone can decode it.

Why is the Base64 bigger than the original?

Every 3 bytes become 4 characters, so Base64 is about 33% larger than the data it holds, plus line breaks if you wrap it. A 300 KB image becomes about 400 KB of text.

What is URL-safe Base64?

Standard Base64 uses + and /, which have special meanings in web addresses, and = for padding. URL-safe Base64 (Base64url) uses - and _ instead and drops the padding. It is used in JSON Web Tokens (JWT) and links. The decoder accepts both kinds.

How do I turn Base64 into an image or PDF?

Choose Decode and paste the Base64 or a data: URL. The converter recognises PNG, JPG, GIF, WebP, PDF, ZIP, MP3 and other files from their first bytes, shows images, and offers the file to download with the right extension.

How do I put an image in HTML or CSS with Base64?

Encode the image with "Add the data: URL prefix" on, then use the result as the address: <img src="data:image/png;base64,…"> or background-image: url("data:image/png;base64,…"). This is best for small icons; large images load faster as normal files.

Is it safe to paste private data here?

Yes. Encoding and decoding happen in your browser, and nothing you type or open is sent anywhere. Remember that Base64 hides nothing, so do not use it to protect passwords or secrets.

Browse all tools