Free · No upload · Runs in your browser

JPG to Base64 Converter

Drag in a JPG / JPEG photo and instantly get its Base64 string and data URI — ready to paste into HTML, CSS, JSON or JavaScript. One click to copy.

100% client-side. Your photo never leaves your device.

Drop a JPG here

or paste from clipboard · JPG and JPEG both work

JPG to Base64, explained

Encoding a JPG to Base64 turns the photo's binary data into a plain-text string you can embed directly in your code. JPEG is a compressed, lossy format built for photographs, so its Base64 strings are far shorter than an equivalent uncompressed image — handy when you want a small inline thumbnail.

How to use it

<img src="data:image/jpeg;base64,/9j/4AAQSkZJRg..." alt="photo" />

.banner { background-image: url(data:image/jpeg;base64,/9j/4AAQSkZJRg...); }

Keep an eye on size

Base64 inflates data by about 33%, and an inlined photo can't be cached on its own. For a large hero image, a normal .jpg file the browser can cache will load faster. Reserve Base64 for small thumbnails, avatars, or single-file deliverables like emails and self-contained HTML reports.

Private by design

The conversion runs locally with your browser's FileReader API — no upload, no server. Check your Network tab and you'll see the photo never goes anywhere.

Frequently asked questions

What does a JPG Base64 string start with?

A JPEG data URI starts with data:image/jpeg;base64, and the body typically begins with /9j/ — the Base64 signature of the JPEG header.

Should I inline a large JPG as Base64?

Usually not. Base64 adds about 33% to the size and inlined images can't be cached separately. For large photos keep a normal .jpg; reserve Base64 for small images or single-file deliverables.

Is the conversion private?

Yes. Everything runs in your browser with the FileReader API. The JPEG is never uploaded to any server.