Convert JPG and JPEG images to Base64 strings. Get data URIs for HTML img tags, CSS backgrounds, or raw Base64 for APIs. Runs locally in your browser.
Drag & drop files here
or click to browse. Select multiple files at once. (max 50 MB each)
JPEG (Joint Photographic Experts Group) is the most common image format on the web, used for photographs and complex images where lossy compression produces acceptable quality at small file sizes. This tool converts any JPG/JPEG file to a Base64 string for embedding in code.
JPEG files are already compressed. A typical photograph might be 200-800 KB depending on resolution and quality settings. After Base64 encoding, that becomes 267 KB to 1.07 MB of text. This is important context for deciding whether to inline the image or serve it separately.
The correct MIME type for JPEG is image/jpeg, not image/jpg. This tool automatically sets the MIME type from the file, so data URIs always use the correct data:image/jpeg;base64,... prefix. Some systems accept image/jpg as an alias, but image/jpeg is the IANA-registered type.
JPEG files can contain EXIF metadata: camera model, GPS coordinates, orientation, timestamps. Base64 encoding preserves all of this because it encodes the complete file bytes. If you need to strip EXIF before sharing (for privacy), do that before encoding. The HTML <canvas> trick (drawing the image to canvas and exporting) strips EXIF but also re-encodes the JPEG, changing quality.
Email clients block external images by default. Embedding a small logo or header image as a Base64 data URI ensures it renders immediately. Keep it under 10 KB. Gmail clips emails larger than 102 KB, and Base64 images count toward that limit.
REST APIs that accept image uploads often support Base64 encoded bodies as an alternative to multipart form data. This simplifies the request from the client side:
{
"image": "/9j/4AAQSkZJRgABAQ...",
"filename": "photo.jpg"
}
When generating HTML on the server (PDF generation, email rendering, single file exports), Base64 data URIs let you produce a self contained document without managing image file references.
JPEG compression ratios mean the resulting Base64 string can be large. For web pages:
For the reverse operation, Base64 to Image decodes Base64 strings back to downloadable images. For other image formats, see PNG to Base64, SVG to Base64, or the general Image to Base64 converter.
Nothing you paste leaves this tab. Every tool runs entirely in your browser — no upload, no server, no account.