utills.
English
JPG to Base64

Convert a JPG to Base64

Encode a JPG to a Base64 string or data URI with copy-ready CSS and HTML snippets — free and right in your browser.

Drop an image to encode

Drag & drop, paste, or pick a file

PNG · JPG · WebP · GIF · SVG — encoded on your device

JPG & JPEGCopy or .txtNo sign-up PNG · JPG · WebP · GIF · SVG

Encoding JPG photos to Base64

JPG is the most common photo format, and turning one into Base64 is handy when you need a photo inline — in an HTML email, a single-file document, or an API payload — without hosting it separately. Encoding produces a data:image/jpeg;base64 URI you can paste straight into your markup or CSS.

The tool reads your JPG in the browser and shows the exact Base64 of the original file, so the photo isn't re-compressed and the decoded result is identical. You get the raw Base64, the data URI, and ready CSS and HTML snippets, each with copy and .txt download.

How to convert a JPG to Base64

  1. Open your JPG. Drag the JPG or JPEG onto the tool, choose a file, or paste it.
  2. Choose your output. Pick the raw Base64, the data:image/jpeg URI, a CSS rule, or an <img> tag.
  3. Copy or download. Tap Copy to use it right away, or download a .txt file.

Mind the size for photos

Photos are larger than icons, and Base64 adds about a third on top. For a big JPG, a normal hosted file usually loads faster and caches better — inline Base64 is best for small images or single-file use cases.

JPG to Base64: how it works

JPEG is the most common lossy photo format; turning a JPG into Base64 is useful when a photo has to travel as text — inside an email, a JSON payload, or a single-file document — rather than as a hosted file.

Data URI shape
data:image/jpeg;base64,/9j/4AAQSkZJRgABA…
Size impact
The existing JPEG compression is untouched; Base64 then adds its usual ~33% on top, so the string is about 133% of the original .jpg size. There is no second round of lossy compression, so the photo's quality is unchanged.

When inlining as Base64 makes sense

  • You need a small photo embedded inline in an HTML email or a one-file HTML export.
  • An API or message format carries the image as a string field instead of a file upload.
  • You want a thumbnail-sized photo available without a separate request.

When a normal file or URL is better

  • The photo is full-size or high-resolution — Base64 inflates it by a third and the browser must parse the whole blob on every load, so a hosted, cacheable .jpg is faster.
  • The image is shared across pages or changes often, where an external URL caches and updates more cleanly.

Practical tip

Both .jpg and .jpeg are the same JPEG format and encode identically. Every JPEG data URI starts with data:image/jpeg;base64,/9j/ — the /9j/ opening is the Base64 of JPEG's FF D8 FF start-of-image marker, a quick way to recognise a JPEG string.

More Base64 & data URI tools

Frequently asked questions

Does encoding a JPG reduce its quality?

No. Base64 is a lossless text copy of the original JPG bytes — it doesn't re-encode the photo, so quality is unchanged.

Does it work with .jpeg as well as .jpg?

Yes. Both extensions are the same JPEG format and encode identically to a data:image/jpeg URI.

Why is the Base64 bigger than my JPG?

Base64 turns every 3 bytes into 4 text characters, adding roughly 33%. That overhead is normal for any Base64 encoding.

Where is my image processed?

The encoding and decoding happen in your browser, so the result is created on your own device. How any data associated with the tool is handled is described in our privacy policy.

More image tools

Find your next tool

37 tools

Compress image Shrink file size while keeping quality. Resize image Change width and height to any size. Crop image Trim images to the exact frame you want. Convert image Switch between JPG, PNG, WebP and more. Remove background Erase the background in one click. Image to PDF Combine images into one PDF document. Rotate & Flip Turn, straighten, and mirror photos. Image to text Pull editable text out of any image. HEIC to JPG Open iPhone HEIC photos as JPG. Watermark Stamp text or logos over your images. Collage Arrange multiple photos into a grid. Favicon Generator Build favicons in every required size. Color Picker Grab hex colors and build palettes. Blur & Pixelate Obscure faces, plates, and private bits. Enhance Auto-fix brightness, contrast, and color. Passport Photo Prepare photos for ID and passport applications. Signature Clean up and extract handwritten signatures. Photo Effects Apply filters and vintage looks. Social Image Size covers for common social platforms. Add text to image Caption images and make memes fast. GIF Maker Turn frames or clips into animated GIFs. Border & Frame Add clean borders and photo frames. Mockup Drop screenshots into device frames. SVG Converter Trace raster images into scalable SVG. EXIF Viewer Inspect camera and GPS metadata. Poster & Print Lay out posters and print-ready sheets. Document Scanner Deskew and clean photographed documents. Image to Base64 Encode images into a data-URI string. Placeholder Make dummy placeholder images on demand. Image generator Make gradients, patterns, and avatars. Compare Images See two images side by side with a slider. QR Code Create and download QR codes. Hide Text in Image Embed a secret message inside a picture. Length converter Meters, feet, inches, miles and more. Weight converter Switch between kilograms, pounds and more. Temperature converter Celsius, Fahrenheit, Kelvin and more. Data storage converter Bits, bytes, megabytes and gigabytes.
Tab to move · Enter to open · Esc to close