JPG to Base64 Converter
Up to 10 MB. Nothing is uploaded — the file never leaves your device.
Use this in an <img src> attribute or a CSS url().
Without the data: prefix — for JSON payloads and APIs.
Your files stay private
This conversion runs entirely inside your browser. The image is never uploaded, so nothing you encode here reaches our server or anyone else.
About Converting JPG to Base64
JPG files are photographs, and photographs are big. That single fact changes the calculation compared with encoding an icon: a 200 KB photo becomes roughly 267 KB of text that a browser must download in full, hold in memory and decode before it can show anything. For most websites that is a bad trade. There are, however, three situations where it is exactly the right one.
How to convert JPG to Base64
- 1 Drop your .jpg or .jpeg file onto the upload area.
- 2 Check the size line the tool shows you — it is the number that decides whether inlining is sensible.
- 3 Copy the data URI for HTML and CSS, or the raw string if you are putting it into JSON.
For a normal web page, this is usually a mistake
An ordinary image tag lets the browser fetch the photo in parallel, cache it for months, skip it entirely if it is below the fold, and swap in a smaller version on a phone. Inlining throws all four away at once. The photo now arrives inside the HTML or CSS, blocking the first paint, uncacheable on its own, downloaded even by visitors who never scroll to it, and identical on a 4K monitor and a budget phone. The bigger the photo, the more each of those costs you.
Three cases where it is right
Email templates come first: many clients block external images by default, so an inlined photo is the only one that reliably appears. Second, tiny placeholders — a deliberately blurred image a few hundred bytes wide, inlined so something is visible while the real photo loads. Third, moving a picture through a system that only accepts text: a JSON API, a webhook payload, a database column, a message queue. In all three the alternative is not a faster image; it is no image at all.
Shrink the photo before you encode it
Base64 has no opinion about what you feed it — it enlarges a 3 MB holiday snap just as faithfully as a thumbnail. So do the work in the right order: crop to the size you will actually display, lower the JPG quality until the difference stops being visible, and only then encode. A photo that was going to be shown 400 pixels wide has no business being encoded at 4000. If the result still runs to hundreds of kilobytes, that is the tool telling you to link to the file instead.