A virtual teacher who reveals to you the great secrets of Base64

JPG to Base64

Convert JPG to Base64 online and use it as a generator, which provides ready-made examples for data URI, img src, CSS background-url, and others. The JPG to Base64 converter is identical to Image to Base64, with the only difference that it forces the mime type to be “image/jpg” (even if the uploaded file has a different content type or it cannot be detected). Please note that the JPG to Base64 encoder accepts any images types with a size of up to 50 MB. If you are looking for the reverse process, check Base64 to JPG.


How to convert JPG to Base64 online

  1. Choose the source of image from the “Datatype” field.
  2. Paste the URL or select a JPG image from your computer.
  3. If necessary, select the desired output format.
  4. Press the “Encode JPG to Base64” button.
  5. Download or copy the result from the “Base64” field.

About JPG

  • Name: JPEG
  • Developer: Joint Photographic Experts Group
  • MIME types: image/jpeg
  • File Extensions: .jpg, .jpeg, .jpe, .jif, .jfif, .jfi
  • Uniform Type Identifier: public.jpeg
  • Type of Format: Lossy image

Output formats

If you do not know what output format you need, check the following examples to see how will look the result of the same Base64-encoded JPG image formatted in each of the available formats (as an example image I use a one-pixel red dot JPG file):

Plain text:
/9j/4AAQSkZJRgABAQAAZABkAAD/2wCEABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBREREREREREREREREREREREREREREREREREREREQBFRkZIBwgJhgYJjYmICY2RDYrKzZERERCNUJERERERERERERERERERERERERERERERERERERERERERERERERERP/AABEIAAEAAQMBIgACEQEDEQH/xABMAAEBAAAAAAAAAAAAAAAAAAAABQEBAQAAAAAAAAAAAAAAAAAABQYQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AJQA9Yv/2Q==
Data URI:
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAZABkAAD/2wCEABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBREREREREREREREREREREREREREREREREREREREQBFRkZIBwgJhgYJjYmICY2RDYrKzZERERCNUJERERERERERERERERERERERERERERERERERERERERERERERERERP/AABEIAAEAAQMBIgACEQEDEQH/xABMAAEBAAAAAAAAAAAAAAAAAAAABQEBAQAAAAAAAAAAAAAAAAAABQYQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AJQA9Yv/2Q==
CSS Background Image:
.base64 {
  background-image: url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAZABkAAD/2wCEABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBREREREREREREREREREREREREREREREREREREREQBFRkZIBwgJhgYJjYmICY2RDYrKzZERERCNUJERERERERERERERERERERERERERERERERERERERERERERERERERP/AABEIAAEAAQMBIgACEQEDEQH/xABMAAEBAAAAAAAAAAAAAAAAAAAABQEBAQAAAAAAAAAAAAAAAAAABQYQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AJQA9Yv/2Q==")
}
HTML Favicon:
<link rel="shortcut icon" href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAZABkAAD/2wCEABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBREREREREREREREREREREREREREREREREREREREQBFRkZIBwgJhgYJjYmICY2RDYrKzZERERCNUJERERERERERERERERERERERERERERERERERERERERERERERERERP/AABEIAAEAAQMBIgACEQEDEQH/xABMAAEBAAAAAAAAAAAAAAAAAAAABQEBAQAAAAAAAAAAAAAAAAAABQYQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AJQA9Yv/2Q==" />
HTML Hyperlink:
<a href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAZABkAAD/2wCEABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBREREREREREREREREREREREREREREREREREREREQBFRkZIBwgJhgYJjYmICY2RDYrKzZERERCNUJERERERERERERERERERERERERERERERERERERERERERERERERERP/AABEIAAEAAQMBIgACEQEDEQH/xABMAAEBAAAAAAAAAAAAAAAAAAAABQEBAQAAAAAAAAAAAAAAAAAABQYQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AJQA9Yv/2Q=="></a>
HTML Image:
<img alt="" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAZABkAAD/2wCEABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBREREREREREREREREREREREREREREREREREREREQBFRkZIBwgJhgYJjYmICY2RDYrKzZERERCNUJERERERERERERERERERERERERERERERERERERERERERERERERERP/AABEIAAEAAQMBIgACEQEDEQH/xABMAAEBAAAAAAAAAAAAAAAAAAAABQEBAQAAAAAAAAAAAAAAAAAABQYQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AJQA9Yv/2Q==" />
HTML Iframe:
<iframe src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAZABkAAD/2wCEABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBREREREREREREREREREREREREREREREREREREREQBFRkZIBwgJhgYJjYmICY2RDYrKzZERERCNUJERERERERERERERERERERERERERERERERERERERERERERERERERP/AABEIAAEAAQMBIgACEQEDEQH/xABMAAEBAAAAAAAAAAAAAAAAAAAABQEBAQAAAAAAAAAAAAAAAAAABQYQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AJQA9Yv/2Q==">
  The “iframe” tag is not supported by your browser.
</iframe>
JavaScript Image:
var img = new Image();
img.src = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAZABkAAD/2wCEABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBREREREREREREREREREREREREREREREREREREREQBFRkZIBwgJhgYJjYmICY2RDYrKzZERERCNUJERERERERERERERERERERERERERERERERERERERERERERERERERP/AABEIAAEAAQMBIgACEQEDEQH/xABMAAEBAAAAAAAAAAAAAAAAAAAABQEBAQAAAAAAAAAAAAAAAAAABQYQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AJQA9Yv/2Q==";
document.body.appendChild(img);
JavaScript Popup:
window.onclick = function () {
  this.open("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAZABkAAD/2wCEABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBREREREREREREREREREREREREREREREREREREREQBFRkZIBwgJhgYJjYmICY2RDYrKzZERERCNUJERERERERERERERERERERERERERERERERERERERERERERERERERP/AABEIAAEAAQMBIgACEQEDEQH/xABMAAEBAAAAAAAAAAAAAAAAAAAABQEBAQAAAAAAAAAAAAAAAAAABQYQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AJQA9Yv/2Q==");
};
JSON:
{
  "image": {
    "mime": "image/jpeg",
    "data": "/9j/4AAQSkZJRgABAQAAZABkAAD/2wCEABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBREREREREREREREREREREREREREREREREREREREQBFRkZIBwgJhgYJjYmICY2RDYrKzZERERCNUJERERERERERERERERERERERERERERERERERERERERERERERERERP/AABEIAAEAAQMBIgACEQEDEQH/xABMAAEBAAAAAAAAAAAAAAAAAAAABQEBAQAAAAAAAAAAAAAAAAAABQYQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AJQA9Yv/2Q=="
  }
}
XML:
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <image mime="image/jpeg">/9j/4AAQSkZJRgABAQAAZABkAAD/2wCEABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBREREREREREREREREREREREREREREREREREREREQBFRkZIBwgJhgYJjYmICY2RDYrKzZERERCNUJERERERERERERERERERERERERERERERERERERERERERERERERERP/AABEIAAEAAQMBIgACEQEDEQH/xABMAAEBAAAAAAAAAAAAAAAAAAAABQEBAQAAAAAAAAAAAAAAAAAABQYQAQAAAAAAAAAAAAAAAAAAAAARAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AJQA9Yv/2Q==</image>
</root>

If I missed an important output format for Base64-encoded JPG images, please let me know — I would love to implement it.

Comments (69)

I hope you enjoy this discussion. In any case, I ask you to join it.

  • JORGE-RAMOS,
    Can you give me an example of how you convert url to base64 please
    • Administrator,
      I'm not sure I understand you, but if your are trying to convert a remote JPG to Base64, then you can specify its URL by selecting "Remote URL" from the "Datatype" drop-down list.
    • Jay,
      It’s just an image I got off the internet. I’m new this I figured I see if any on the net would have something.
      • Roxy,
        I found this odd image while I was just messing around, it said, whoa.. you've entered through the wrong door, I did a lot of researching and it took me to many odd websites, even what I'm pretty sure was the dark web. now I'm stuck here and IDK what to do from here.
  • Stefano,
    Hi there,

    I have encoded my html signature into base64 files, it looks great.
    I have sent it to my sister to test it (she lives in Italy) and she could only see empty squares. Is that because of a different system? She couldn't even see it on her Iphone, which instead works perfectly on my Iphone. Any help?
  • Kamlesh,
    Need to develop hard code
  • Kalidsherefuddin,
    Please help me about it
  • nqhXncMU,
    0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z
    • Nore,
      Nice try to inject sql
  • nqhXncMU,
    -1)) OR 621=(SELECT 621 FROM PG_SLEEP(15))--
  • bobbyfritze,
    This works well for editing a Vcard with a profile image, thanks Gurus!
  • Ahmadi,
    Hi I can’t not join
  • Ahmadi,
    Hi I am don’t join
  • Ahmadi,
    Hi how are you
  • DonaldPump,
    STFU Ahmadi!
  • MetheMyself,
    I have jpeg image converted to base64 with size 128kb. Is it possible to compress this?

    Thanks
  • Ronaldino,
    can I have a code for a app that haves games in my school computer
  • Hufanga,
    Jake,can I please get a code for a app that has games cause the one you gave me afilite.app got banned
  • Ronaldino,
    Alexander me puedes mandar un Codigo para una app para jugar juegos en la computadora de la escuela?
    • Alexander,
      Hola,Ronaldino no te puedo mandar codigo ahora mismo porque el cosa donde puero comprar los codigos ya no tienen yo creo pal otro martes o jueves de lo puero mandar para un app, Que tengas Un Buen Dia Ronaldino.
  • Ronaldino,
    can I have a code for a app that haves games in my school computer
  • Ronaldino,
    ok gracias Alexander
  • Alexander,
    Ronaldino, el Code Ninja apenas puso nuevo codigos para unos app, esto son unos apps, primero irunblocked artclasssitte mexi's unblocked games. Si no sirve dime okay, Que tiene un buen dia ronaldino.
  • Ronaldino,
    Alexander no me sirvio la app no se si la escribi mal pero no me sirvio.
  • Alexander,
    Ronaldino, tengo uno mas no tiene muchos juegos pero es Neal.fun:g
  • Alexander,
    Ronaldino, I can type in English Aswell because I was born in America, but I live in Mexico, the apps probably don't work because they were probably moved to a different page or it was probably just banned, but I know your friend Hufanga and he works for me now and he actually makes codes for me now and I sell the codes and I also made a soccer game he said he told you about and you don't see the messages of me and him talking because we talk on a different page, I'm also working on making a app and hufanga is also helping me and were adding TikTok YouTube and games like subway surfers, clash royale, Fortnite, Roblox and a bunch of other fun games, Hufanga is also working on making the code for the app, have a great day ronaldino.
  • Hufanga,
    Alexander, I'm almost done with the code I just need to add some more numbers and phrases and then I will submit it to you than you can add the code to the app than I will help you with the app, Ima also tell some friends aswell.
  • Alexander,
    Hufanga, I just finished building the app now you need to finish with the code than we are done with the app, also I'm sorry you cant tell anyone about the app NO ONE because I dont want my app getting banned, when we make the next app you can tell some peolpe, for now just lay low and dont tell anyone and if anyone finds out POR EL AMOR DE DIOS, do something, now hurry and send me the code.
  • Hufanga,
    aligh I wont tell anyone and ima finish the code in school tomorrow with ronaldino to see if he can help me, ill talk to u tomorrow
  • Hufanga,
    Alexander, I finish with the code and its long also did you add the game I told you
  • Ronaldino,
    Alexander, yo I Hufanga ya terminators El codigo
  • Alexander,
    okay gracias Ronaldinho El app va ser bueno, que Tenga un buen dia
  • Hufanga,
    I'ma add the app now
  • Ronaldino,
    Alexander,Hufanga ya me enseno tu app ESTA buena
  • Alexander,
    Hey Ronaldino, do you wanna make an app with me and hufanga were gonna make a new one
  • Hufanga,
    yea uhhh Alexander, uhhhhh our app got banned....
  • Alexander,
    WHAT NO WAY WDYM OMG
  • Alexander,
    it doesn't matter I made another website only me and you know about anyways so RIP FROGIES ARCADE
  • Hufanga,
    Ronaldinho cant send a message.
  • Ronaldino,
    ya me deja escrivir pero haora como voy a jugar Roblox:(
  • Alexander,
    you cant play Roblox sadly but maybe we will tell u about the website
  • Ronaldino,
    oh ok I guess?
  • Hufanga,
    Do we really we have to tell him about the app I mean it is okay but he cant tell anyone
  • Alexander,
    Did you get the apps Hufanga
  • Hufanga,
    Yea, im looking at them right now they work on my home compuer dont know if they will work on the school computers
  • Hufanga,
    Alexnader, we spent the whole night talking damm bru my eyes hurt as heck bru we have over 15+ apps if they dont work we gotta spend 4 hours again looking for apps that have games and I also got the hard code ready for one of the apps
  • Alexander,
    I know bro holy im actauly tired and we have to do it again today.
  • Hufanga,
    Yea lets get to work anyways we have a limit to find 50 of the apps
  • Alexander,
    Okay tell miguel to help us
  • Miguel,
    Im here let do this
  • Hufanga,
    Aight lets do this
  • Miguel,
    BOYZ GANG ONTOP 1 2 3 BOYZGANG
  • Hufanga,
    BOYZ GANG ON TOP BABY
  • Alexander,
    BOYZ GANG ON TOP BABY
  • Alexander,
    Hufanga, we need a 4th person on our team, got anyone to join
  • Hufanga,
    Yea ima ask ronaldino if he wants to join i will tell him his job if he joins
  • Miguel,
    okay lets get to work now boyz
  • Ronaldino,
    Alexander me puedo unir pero quien es migel? le voy a preguntar a Hufanga
  • Hufanga,
    Were gonna add a 5th person to the group.
  • soccerskills,
    I know Ronaldinho and hafunga
  • Hufanga,
    me and Ronaldinho and soccerskills are gonna make the hard code with 132kbm
  • Hufanga,
    Miguel ya vas aser El app verda
  • Hufanga,
    wkv HARD CODE BABY
  • Miguel,
    Ima make the app now and welcome soccer skills to the BOYZ GANG now we will find the best apps and make the best apps also ur job will just be to make codes with hufanga and ronaldino and also I know your real name isnt hufanga, just tell us ur real name
  • Hufanga,
    Fine, since I work in this app now my real name is omar
  • Alexander,
    Im on lets go into the app now to find some hard codes also i finsihed the app i added it now ill tell you on the other page but you cant tell ANYONE
  • Hufanga,
    Okay now lets get to work we needa find all the apps and the codes so YOU CAN FINALLY PAY ME AFTER LIKE 10 YEARS
  • Hufanga,
    I'ma try to find a code
  • Hufanga,
    so were spending all day tommor looking for apps
Add new comment

If you have any questions, remarks, need help, or just like this page, please feel free to let me know by leaving a comment using the form bellow.
I will be happy to read every comment and, if necessary, I will do my best to respond as quickly as possible. Of course, spammers are welcome only as readers.