filetity
LocalThis runs in your browser. The image is not uploaded.

IMAGE -> BASE64 · Local tool

Image to Base64

Turn an image into base64 or a data URL for CSS, HTML or JSON.

Last updated

How do I convert an image to base64?

Drop the image onto filetity's encoder and the base64 appears, ready to copy, either as a complete data URL for CSS and HTML or as the payload alone for a JSON field or a database column. Everything runs in the browser tab, so the file is never uploaded. The number worth looking at is the size: base64 turns three bytes into four characters, so the text is about a third larger than the file, which is why inlining is a good trade for a small icon and a bad one for a photograph, since a data URL cannot be cached separately and is re-sent with every copy of the page or stylesheet holding it. Both figures are shown side by side so the decision is in front of you rather than behind it.

  1. 01 / Your device

    the file stays here

  2. 02 / Browser memory

    the work runs locally

  3. 03 / Back to you

    saved on this device

When you would use this

Situations, not settings.

An icon you want inline in CSS
Saves a request for something small. The size cost is shown next to the original, so you can see when it stops being worth it.
An image that has to travel inside JSON
APIs, webhooks and config files carry text and nothing else. Pick the payload without the prefix, which is what consuming code usually expects.
An email signature that must not hotlink
A data URL renders in most mail clients with no external request, so the logo shows without the images-blocked warning.

How it works / no cloud

A conversion engine, not an upload form.

The file is read into memory and encoded in the page, in chunks, because handing a whole image to the obvious one-line encoder throws a call stack error at around a hundred kilobytes. You get the payload alone or a complete data URL, whichever the place you are pasting into wants.

  • Offline ready
  • Installable app
  • No file limit queue

Straight answers

No accordion. Nothing hidden.

Is it free?
Yes, with no watermark and no page limit.
Does it need an account?
No. There is no account system.
Is my file processed on my device?
Yes. The file is read by your browser and never uploaded. There is no server to send it to.
What formats are supported?
PNG, JPG, GIF, WebP, AVIF, SVG, BMP and ICO in. Base64 text out, with or without the data: prefix.
What are the limits?
Base64 is about a third larger than the file, so a 1 MB image becomes roughly 1.33 MB of text. That is the format, and it is why inlining large images is usually a mistake.
Does it work on mobile?
Yes, on any modern mobile browser. Large files are limited by the memory the phone gives the browser.
Does it work offline?
Yes, once the page has loaded. The tool keeps working with no network connection.
How much bigger does base64 make the file?
About a third. Three bytes become four characters, so a 300 KB image becomes roughly 400 KB of text. That cost is why inlining works well for a small icon and badly for a photograph, and the page shows both numbers so the decision is in front of you.
When is inlining an image actually a good idea?
For something small that would otherwise cost a separate request: an icon, a tiny background, a logo in an email signature. For anything large it is worse than a normal file, because a data URL cannot be cached separately and has to be re-sent with every copy of the page or stylesheet that holds it.
Do I want the data: prefix or just the payload?
CSS and HTML want the whole data URL, prefix included, since they are being given something to load. A JSON field or a database column usually wants the payload alone, because the consuming code adds its own prefix. Both are one click apart here.
Is an SVG worth encoding this way?
Usually not. An SVG is already text, so it can be pasted straight into HTML, and base64 makes it a third larger for nothing. If you do need a data URL for one, URL-encoding it is smaller than base64, though base64 is the safer option when the SVG contains quotes and hashes.
Is my image uploaded to encode it?
No. It is read off your disk by the browser and encoded in the tab. There is no request in the path, which is worth knowing when the thing you are inlining is a client logo or a screenshot from an internal system.

Keep working locally

3 available · more coming