JPG to Base64

Turn JPG photos into Base64 data URIs for email templates, JSON payloads or single file pages, and see right away how large the result is.

Free and private. Everything runs in your browser, nothing is uploaded.

How it works

  1. Add your JPGOpen the file or drop it onto the input box. You can also paste Base64 directly.
  2. Choose the outputPick data URI, Base64, CSS, HTML or Markdown. The preview and sizes update right away.
  3. Copy or downloadCopy the code with one click, or download the image as a file.

Mind the size of photos

Photos are much larger than icons, and Base64 adds about a third on top. For email templates and API payloads that is often fine, but for web pages a separate image file usually loads faster.

Resizing or compressing the photo first can make the Base64 text several times shorter.

About JPG

JPG is the standard format for photos. Photos are usually large, so check the size before embedding one as Base64.

About Base64

Base64 writes binary data as plain text using letters, digits, + and /. A data URI adds the file type in front, for example data:image/png;base64, so browsers know how to show it.

Frequently asked questions

Does converting to Base64 reduce quality?

No. The JPG file is encoded as it is, nothing is recompressed.

Is my image uploaded?

No. The image is read and converted in your browser and never sent to our servers.

Is there a size limit?

There is no fixed limit, but data URIs over about 100 KB make pages and stylesheets heavy. For large images a normal image file is the better choice.

Can I convert other files, like PDFs or fonts?

Yes. Any file becomes a data URI or plain Base64. The CSS, HTML and Markdown options are only offered for images.

How do I turn Base64 back into an image?

Paste the Base64 text or data URI into the input box. The image is shown right away and Download saves it with the right file extension.

Does it work offline?

Yes. After you open the page once, it keeps working without an internet connection.