How to convert an image to Base64
- Add an image by dragging it onto the box, or tap to choose a file from your phone or computer.
- Choose the output: Data URI, Base64 only, HTML
<img>, CSS background or Markdown. For SVG files, decide whether to keep URL-encoding switched on. - Check the preview and sizes. A preview shows the image decoded from the result, and a line shows the original size, the encoded size and how much larger it is.
- Copy or download the text with the copy button or as a .txt file.
Features
- Five ready-to-paste outputs: data URI, raw Base64, an HTML
<img>tag, a CSSbackground-imagerule and a Markdown image. - URL-encoded SVG as a smaller alternative to Base64 for vector images.
- Size comparison showing the original file size, the encoded size and the percentage increase.
- Live preview rendered from the generated data, on a checkerboard so transparency is visible.
- Wide format support: PNG, JPG, WebP, GIF, SVG, AVIF, ICO and BMP.
- Exact encoding, with no resizing or quality loss.
- Size advice when an image is over about 10 KB.
Why use Fileora's image to Base64 converter
Logos, screenshots and design assets are often unreleased or private. Fileora reads and encodes the file in your browser, so the image never leaves your device. It's free, needs no sign-up, and works on a phone, where you can pick an image straight from your gallery.
When inlining an image helps
A data URI puts the image inside your HTML, CSS or JSON instead of in a separate file. That saves a network request, which can help for:
- Small icons and simple shapes, especially SVG, used in CSS.
- HTML emails and single-file documents that must work without external files.
- Placeholders, such as a tiny blurred preview shown while the full image loads.
- Tests, demos and code snippets that should run without extra assets.
- APIs that accept images as Base64 inside a JSON body.
When it hurts
Base64 text is about a third bigger than the image it represents. Inlined images are downloaded again every time the page or stylesheet changes, because they can't be cached on their own. They also sit in the critical path: a large image inside your CSS delays the whole stylesheet, and with it the first paint of your page. As a rule of thumb, keep inlined images under about 10 KB and serve everything else as a normal file.
To get an image under that size first, shrink it with the image compressor or convert it to WebP with the image converter. If you need the exact colour of an icon in CSS, the colour converter gives you HEX, RGB, HSL and OKLCH.