Image to Base64 Converter

Click here to upload your image.
Choose a file or drag it here.

    Image to Base64 Converter

    Upload JPG, PNG, GIF, WebP, SVG or BMP images and instantly get base64 equivalents to directly use in HTML or CSS.

    Allowed image formats: JPG, PNG, GIF, WebP, SVG or BMP

    Allowed image size: 1 MB

    What is Base64 and why it should be used to encode images?

    Base64 is a group of encoding schemes to represent binary data in ASCII characters. Base64 is used, when binary data (such as images or video) needs to be transmitted over systems that are designed only to deal with data in a plain-text format. Encoding images with Base64 system help to avoid data corruption when shipping it across network. The process of encoding is done, by dividing binary data into 6-bit chunks and converting these chunks to the following 64 ASCII characters - 10 digits, 26 lowercase and 26 uppercase latin alphabet letters, + and / signs.

    Base64

    Once converted to Base64, encoded image data will look similar to this (shortened for simplicity):

    data:[][;charset=][;base64],

    you can insert the string as a background-image in CSS:

    .demoImg{ background-image: url("data:image/jpg;base64,/9j/4QMZRXhpZgAASUkqAAgAAAAL...."); }

    The string can be used instead of an URL in the src attribute of the img element in HTML:

    <img width="40" height="30" src="data:image/jpg;base64,/9j/4QMZRXhpZgAASUkqAAgAAAAL...." />