# JPG to Base64

> JPG to Base64 encodes a .jpg or .jpeg photo into text. It runs in your browser, so your files are never uploaded. Works on phone and computer.

Page: https://ishowpdf.com/tools/jpg-to-base64

## What JPG to Base64 does

JPG to Base64 encodes a .jpg or .jpeg photo into text. Use it when an API, a form submission or a test script needs a photo as a string, or when you want a small picture inside an HTML email.

The picker accepts JPG and JPEG files. The output is a data:image/jpeg link or, with the tick removed, just the Base64. Because the photo is not re-saved, its quality and the details stored inside it, such as camera information, are kept exactly as they are in the file.

## How to use JPG to Base64

1. **Choose the photo**: Pick a .jpg or .jpeg file from your device.
2. **Set the prefix**: Leave the data: link on for web pages, or switch it off for an API field.
3. **Copy the string**: Copy it, or keep it as a downloaded .txt file.

## Questions

**Does the Base64 keep my photo's location data?**

Yes, if the photo has it. The file is encoded byte for byte, so any camera or GPS details inside travel with it. Remove them first if you plan to share the text.

**How do I send a photo to an API as Base64?**

Encode it with the data: link turned off and put the text in the field your API asks for.

**Why is the text so long?**

A 300 KB photo becomes roughly 400 KB of text, because Base64 needs 4 characters for every 3 bytes.

More free tools: https://ishowpdf.com/tools
