File size too large
Very large JPGs produce enormous Base64 strings (4/3× the binary size) that bloat HTML or JSON payloads.
Fix: Compress the JPG first or keep Base64 for assets under ~100 KB; reference larger images by URL instead.
header • up to 320x100 / 728x90
Convert JPG or JPEG images into Base64 data URLs for inline HTML, CSS, or JSON — 100% browser-based
content bottom • up to 300x250
sidebar • 160x600
Last reviewed:
JPEG (often saved as .jpg) is a lossy bitmap image format optimized for photographs, trading some image detail for much smaller file sizes.
JPG (also written JPEG) is a lossy compression format used for photographs and full-color images on the web. Encoding a JPG as Base64 embeds the binary into a text-safe data URL.
JPG to Base64 Encoder accepts a JPG file and produces a `data:image/jpeg;base64,…` string you can paste directly into HTML `<img>` tags, CSS `background-image`, or JSON payloads.
photo.jpg (binary, 128 KB)
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAg…
Very large JPGs produce enormous Base64 strings (4/3× the binary size) that bloat HTML or JSON payloads.
Fix: Compress the JPG first or keep Base64 for assets under ~100 KB; reference larger images by URL instead.
Some consumers reject `data:image/jpg;base64,…` (with lowercase jpg).
Fix: Always use `image/jpeg` in the data URL prefix — that is the official MIME type.
No. The conversion happens entirely in your browser using the File API — nothing is sent to a server.
Roughly 4/3 the original binary size. A 100 KB JPG becomes a ~137 KB Base64 string.
Yes — use the `Copy raw Base64` button to get the string without `data:image/jpeg;base64,` in front.
Yes, any valid JPG/JPEG the browser can read is encoded byte-for-byte.
Related encoders and image tools: You can also browse the full Encoders & Decoders category for more options.
Decode a Base64 data URL or string and download it as a JPG image — all client-side
Encode PNG images as Base64 data URLs with transparency preserved for inline CSS, HTML, and emails
Convert modern WebP images into Base64 data URLs for inline embedding in web pages and emails
Convert local image files into Base64 text ready to paste into email, JSON payloads, or data URLs
Encode or decode Base64 strings
Convert JPG/JPEG images to PNG format
Crop any image to a custom rectangle with precise pixel coordinates or preset aspect ratios — client-side only
Resize any image to exact pixel dimensions or a percentage, with optional aspect-ratio lock and instant PNG/JPG export
Convert BMP bitmap images into Base64 data URLs for embedding in HTML, email, or legacy apps
Turn GIF images (including animated GIFs) into Base64 data URLs ready to embed inline in HTML or CSS
Encode .ico favicon files as Base64 data URLs for inline HTML favicons or web manifests
Encode SVG vector images as Base64 data URLs so you can paste them directly into CSS background-image or HTML