Free Online Tool

Base64 Encoder & Decoder

Convert text, images (including SVG) and files to Base64 and back. Drag and drop, then copy.

Images, SVG, text and any file Runs in your browser · nothing is uploaded

At a Glance

Acceledesk Base64 Encoder & Decoder is a free online tool that converts text and files to Base64 and back. Drag and drop any image, including PNG, JPG, GIF, WebP and SVG, or any other file up to 10 MB to get plain Base64, URL-safe Base64, a data URI, a CSS background-image or an HTML img tag. Paste Base64 or a data URI to decode it to text, a previewable image or a downloadable file, with the file type detected automatically. Text is encoded as UTF-8, and everything runs in the browser, so files are never uploaded. It works in Safari, Chrome, Edge and Firefox on desktop and mobile.

Encodes
Text (UTF-8) and any file up to 10 MB
Images
PNG, JPG, GIF, WebP, SVG, BMP, ICO and AVIF
Output
Base64, URL-safe Base64, data URI, CSS or HTML img tag
Decodes
Base64 or data URI to text, image preview or file download
Privacy
Runs in your browser; files are never uploaded
Cost
Free, works in every browser with no sign-up

How It Works

1. Add text or a file Type, paste, or drag and drop any image or file.
2. Pick a format Base64, data URI, CSS or an HTML img tag.
3. Copy or download Paste it into your code, email or API request.

Features

Drag and drop

Drop, browse or paste any image or file to encode it instantly.

Every image type

PNG, JPG, GIF, WebP, SVG, BMP, ICO and AVIF, with a live preview.

Ready-to-paste code

Data URIs, CSS background-image and HTML img tags with dimensions.

Smart decoding

Detects text, images and file types, and accepts URL-safe Base64.

Private by design

Everything runs on your device. Files are never uploaded.

Works everywhere

Safari, Chrome, Edge and Firefox on desktop, iPhone, iPad and Android.

How to Encode Text or an Image to Base64

Encoding turns text or the bytes of a file into plain Base64 characters that can be pasted anywhere text is allowed.

  1. Choose the Encode tab.
  2. Type or paste text, or drag and drop an image or file onto the drop area (or press Choose a file).
  3. Pick an Output format: Base64, data URI, CSS background-image or HTML img tag. Optionally turn on URL-safe Base64 or 76-character lines.
  4. Press Copy to copy the result, or Download to save it as a text file.

How to Decode Base64 to Text or an Image

Decoding turns Base64 back into the original text, image or file, exactly as it was before it was encoded.

  1. Choose the Decode tab.
  2. Paste the Base64 text or data URI, or drop a text file that contains it.
  3. The tool detects whether it is text, an image or another file and shows the text or an image preview.
  4. Press Copy to copy decoded text, or Download to save the decoded image or file.

How Base64 Works

Base64 splits data into groups of 3 bytes (24 bits) and writes each group as 4 characters of 6 bits each, chosen from an alphabet of 64 characters. When the data does not divide evenly into groups of 3 bytes, one or two equals signs (=) are added as padding. Text is converted to bytes with UTF-8 first, so every language and emoji is supported.

InputBase64Note
ManTWFu3 bytes become 4 characters
MaTWE=One padding character
MTQ==Two padding characters
Hello, World!SGVsbG8sIFdvcmxkIQ==13 bytes become 20 characters

Using Base64 Images in HTML and CSS

A data URI embeds an image directly in a web page, so the browser does not need a separate request to load it. Choose HTML <img> tag or CSS background-image as the output format to get code like this:

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." width="32" height="32" alt="Logo">

.icon {
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0i...");
}

Data URIs are best for small images such as icons, logos and placeholders. Large images are better served as normal files, because Base64 is about 33% larger and cannot be cached separately from the page or stylesheet.

Popular Uses

  • Web development: embed icons, logos and SVGs in HTML, CSS or JavaScript as data URIs.
  • APIs and JSON: send images or files in a JSON request or response, which only supports text.
  • Email: MIME email attachments are Base64 encoded in 76-character lines.
  • Debugging: decode Base64 from logs, cookies, HTTP headers, Basic authentication and JSON Web Tokens to see what they contain.

Frequently Asked Questions

What is Base64 encoding?

Base64 is a way of writing any data, such as text, an image or a file, using only 64 safe characters: A to Z, a to z, 0 to 9, plus (+) and slash (/), with equals signs (=) as padding. It lets binary data travel through systems that only handle plain text, such as email, JSON, XML, HTML and CSS. It is defined in RFC 4648.

How do I convert an image to Base64?

Choose the Encode tab and drag and drop the image onto the drop area, or press Choose a file. The Base64 appears instantly. Pick Data URI, CSS background-image or HTML img tag in the Output format list to get code you can paste straight into a web page, then press Copy.

How do I convert Base64 to an image?

Choose the Decode tab and paste the Base64 text or the full data URI (starting with data:image/). The tool detects the image type, shows a preview with its size and dimensions, and lets you download it as a file with the right extension.

Can I encode SVG files to Base64?

Yes. Drop an SVG file to get its Base64 or a data:image/svg+xml;base64 data URI for use in CSS or an img tag. Decoded SVGs are previewed safely as an image, and their XML source is shown as text so you can copy or edit it.

Is Base64 encryption?

No. Base64 is an encoding, not encryption. Anyone can decode Base64 without a key, so it should never be used to protect passwords or private information. To keep a message private, use encryption such as AES-256 instead.

Why is Base64 bigger than the original file?

Base64 uses 4 characters to represent every 3 bytes of data, so the encoded text is about 33% larger than the original, plus a few padding characters. A 30 KB image becomes about 40 KB of Base64. For this reason, data URIs work best for small images and icons.

What is URL-safe Base64?

URL-safe Base64 (Base64url) replaces the plus (+) and slash (/) characters with minus (-) and underscore (_) and usually drops the trailing equals signs, so the result can be used in web addresses, file names and JSON Web Tokens. The decoder accepts both standard and URL-safe Base64 automatically.

Are my files uploaded to your server?

No. Encoding and decoding run entirely in your browser using standard JavaScript, so your text and files never leave your device and are not stored anywhere. They are cleared when you close or reload the page.

Does it work on iPhone, iPad and Safari?

Yes. The tool works in Safari on Mac, iPhone and iPad, as well as Chrome, Edge, Firefox and Samsung Internet on desktop and mobile. On a phone or tablet, tap Choose a file to pick a photo or file instead of dragging and dropping.

What is the maximum file size?

Files up to 10 MB can be encoded, which is far larger than anything that is practical to embed as Base64. Text of any normal length can be encoded and decoded, and characters from every language and emoji are supported through UTF-8.