About JPG to Base64 Converter
JPG to Base64 conversion turns a photo into a text string that can be embedded directly in HTML, CSS or JSON. That is handy for small icons and logos, email templates, and single-file web pages where you do not want a separate image file.
This page creates the string instantly in your browser and offers seven output formats, including the Data URI form that drops straight into an img tag. Your image is never uploaded anywhere.
How to use it
- Choose your JPG image (any image works too).
- The Base64 output appears automatically - pick Raw Base64 or Data URI for web pages.
- Press Copy and paste the result into your code.
Frequently asked questions
How do I convert JPG to Base64?
Choose your JPG file and the Base64 string appears automatically. Copy the Raw Base64 for code, or the Data URI to embed the image in HTML or CSS.
How do I use a JPG Data URI in HTML?
Paste it as the src of an image tag, like img src="data:image/jpeg;base64,...". The image then loads from the page itself, with no separate file request.
Why is the Base64 string larger than my JPG?
Base64 encoding adds about 33 percent. A 100 KB JPG becomes roughly 137 KB of text, which is why it suits small images best.
Is my image uploaded?
No. Everything runs in your browser. Your image never leaves your device.