TinyFileHub
☕ Support us with a coffee

Image to Base64

Turn pictures into Base64 text and Base64 text back into pictures - many files at once, each with its own file named with the date and time, right in your browser.

Drop images here or tap to choose
JPG, PNG, WebP, GIF, SVG, BMP, ICO, AVIF, HEIC... · any number of files, up to 200 MB in total
🔐 100% on your device · never uploaded
Add one or more images. Each one becomes its own .txt file named like photo_2026-10-29_14-05-09.txt.

Supported formats 11 in → 7 out

11 what you can add:

  • JPG
  • PNG
  • WEBP
  • GIF
  • SVG
  • BMP
  • ICO
  • TIFF
  • AVIF
  • HEIC
  • Base64 text (.txt)

7 results:

  • Data URI
  • Plain Base64
  • HTML <img> tag
  • CSS background
  • TXT file per image
  • Image file per text
  • ZIP of all

How to use the Image to Base64

  1. 1Choose a tab: Image to Base64, or Base64 to Image.
  2. 2Image to Base64: add one or more pictures (up to 200 MB in total) and pick the output - data URI, plain Base64, HTML <img> tag or CSS. Base64 to Image: add .txt files that contain Base64, or paste the text.
  3. 3Press Convert. Every file gets its own result named like photo_2026-10-29_14-05-09.txt (or .png, .jpg...). Copy it, download it, or download everything as one ZIP.

Base64 images explained: what they are and when to use them

Base64 is a way to write any file - including a picture - using only 64 plain characters (A-Z, a-z, 0-9, + and /). Because the result is ordinary text, a picture can travel inside HTML, CSS, JSON, e-mail or a database field. This guide explains how it works and when it helps.

Common uses

Small icons in web pages

Put a tiny logo or icon straight into HTML or CSS as a data URI, so the page needs one download less.

APIs and JSON

Many web services and AI tools expect pictures as Base64 text in a JSON request. Use plain Base64 for these.

HTML e-mails and signatures

Some e-mail templates embed small images as Base64 so they show without loading anything from the internet.

Saving pictures in databases

Store a small picture in a text column or a configuration file when a separate file is not practical.

Debugging and testing

Decode a Base64 string from a log, an API response or a web page to see which picture it really holds.

Recovering pictures

Turn Base64 text you saved earlier, or copied from page source, back into a normal image file.

How Base64 works

Every 3 bytes of the file are split into four 6-bit groups, and each group becomes one of 64 characters. At the end, = signs fill up the last group. That is why Base64 text is always about one third larger than the file it holds.

Data URI, plain Base64, HTML and CSS

A data URI adds a short start such as data:image/png;base64, so browsers know the picture type. Plain Base64 is just the encoded letters, as most APIs want. The HTML and CSS options wrap the data URI in an <img> tag or a background-image rule ready to paste.

Many files and the 200 MB limit

Add as many pictures or text files as you need. The tool adds up their sizes and asks you to remove files if the total is above 200 MB. Each file is converted on its own and gets its own result, named after the original with the date and time, for example photo_2026-10-29_14-05-09.txt.

Reading messy Base64

Copied Base64 is often wrapped in quotes, split into lines of 76 characters, placed inside HTML or JSON, or written in the URL-safe style with - and _. The decoder skips all of this, finds the Base64 part and rebuilds the file.

Finding the real picture type

The picture type is read from the first bytes of the decoded data, not only from the label, so a PNG saved with the wrong label still comes out as a .png. Data that is not a picture, such as a PDF, is reported instead of being saved as a broken image.

Privacy

Everything runs in your browser. Your pictures and text are not uploaded, logged or stored.

Troubleshooting

It says the Base64 is not valid

Part of the text is probably missing or was changed while copying. Copy it again in full, or save it as a .txt file and add the file.

The picture looks broken

If the text was cut off, only part of the picture can be rebuilt. Use the complete Base64 text.

No preview for HEIC or TIFF

Most browsers cannot show these formats. The downloaded file is still correct and opens in a photo app.

Copy does not work for very big results

Clipboards have limits. Use Download .txt for large pictures instead.

Available in 55 languages

The whole site - menus, buttons, guides and messages - can be switched to 55 languages, including English, Hindi, Bengali, Tamil, Telugu, Marathi, Gujarati, Kannada, Malayalam, Punjabi, Odia, Assamese, Nepali, Urdu, Arabic, Spanish, French, German, Portuguese, Italian, Russian, Turkish, Japanese, Korean and Chinese. Use the language menu in the top bar; your choice is remembered, and the file formats and tools work exactly the same in every language.

Why use TinyFileHub

  • Both directions in one place: image to Base64 and Base64 to image
  • Many files in one go - the only limit is 200 MB for all files together; remove files if the total is higher
  • One result per file, named after the original with the date and time, so nothing is overwritten
  • Four output styles: data URI, plain Base64, ready-to-paste HTML <img> tag and CSS background-image
  • Reads Base64 with or without the data:image/...;base64, start, with line breaks, inside HTML, CSS or JSON, and URL-safe Base64
  • Finds the real picture type from the data itself (JPG, PNG, GIF, WebP, BMP, ICO, SVG, TIFF, AVIF, HEIC) and shows a preview with its size in pixels
  • Runs in your browser - your pictures and text are never uploaded

Tips and good to know

Which output should I choose?

Data URI for pasting into a src or url() yourself, HTML <img> tag to paste straight into a web page, CSS for a background, and plain Base64 for APIs, JSON and databases that ask for just the encoded text.

Why is the text bigger than the picture?

Base64 writes every 3 bytes as 4 letters, so the text is about 33% larger than the image. That is normal and the picture is not changed.

When is Base64 a good idea on a website?

For small icons and logos (a few KB) it saves a separate download. For big photos it makes pages heavier and slower - keep them as normal image files.

Round trip

A .txt made here turns back into exactly the same picture, byte for byte. The new file keeps the original name with a fresh date and time.

Frequently asked questions

Is the Image to Base64 converter free?

Yes. No sign-up, no watermark and no daily limit.

How many images can I convert at once?

As many as you like, as long as all files together are no more than 200 MB. If the total is higher, the tool tells you to remove some files.

Are my images uploaded?

No. Encoding and decoding happen inside your browser; nothing is sent to our servers.

Why does my Base64 not turn into a picture?

The text may be cut off, changed, or hold something that is not an image (for example a PDF). The tool tells you which one it is.