Monu Tools

Εικόνα σε Base64

Μετατρέψτε μια εικόνα σε data URI Base64 για ενσωμάτωση σε HTML, CSS ή JSON, εξ ολοκλήρου στο πρόγραμμα περιήγησής σας.

Πώς να χρησιμοποιήσετε το Εικόνα σε Base64

  1. 01

    Επιλέξτε μια εικόνα από τη συσκευή σας.

  2. 02

    Αντιγράψτε το data URI, ή το έτοιμο απόσπασμα CSS.

  3. 03

    Επικολλήστε το στο HTML, CSS ή JSON σας.

What this converter does

This image to Base64 converter turns a picture into a data URI, a long text string that embeds the image directly, plus a ready-to-use CSS background snippet. You can inline an image instead of linking to a separate file.

It runs locally in your browser, so your image is read on your device and never uploaded.

Why inline an image

A data URI carries the whole image inside the markup, so the browser does not make a separate network request to fetch it. For small assets like icons, that saved round trip can make a page feel faster.

The trade-off: size and caching

The catch is size and caching. Base64 adds roughly 33 percent overhead because it represents binary data with a limited text alphabet, and an inlined image cannot be cached separately, so it is downloaded again with every page that contains it.

The rule of thumb is to inline small images, icons, tiny logos or a sprite, where avoiding a request is worth the overhead, and to keep larger images as normal files that the browser can cache and load in parallel.

Where data URIs work

Data URIs work anywhere a URL is accepted: an img src, a CSS background, or a field in JSON or an email template. That makes them handy for self-contained snippets.

Συχνές ερωτήσεις

Ανεβαίνει η εικόνα μου σε διακομιστή;

Όχι. Η εικόνα διαβάζεται εξ ολοκλήρου στο πρόγραμμα περιήγησής σας, οπότε δεν φεύγει ποτέ από τη συσκευή σας.

Πότε να χρησιμοποιήσω data URI;

Για μικρές εικόνες όπως εικονίδια, όπου η αποφυγή ενός επιπλέον αιτήματος δικτύου αξίζει την αύξηση μεγέθους. Για μεγάλες εικόνες, ένα κανονικό αρχείο είναι καλύτερο.

Γιατί το Base64 είναι μεγαλύτερο από το αρχείο;

Η κωδικοποίηση Base64 προσθέτει περίπου 33 τοις εκατό επιβάρυνση επειδή αναπαριστά δυαδικά δεδομένα με ένα περιορισμένο αλφάβητο κειμένου.

Πηγές

Ενσωματώστε αυτό το εργαλείο

Προσθέστε αυτό το εργαλείο στον δικό σας ιστότοπο. Αντιγράψτε το παρακάτω απόσπασμα, ενημερώνεται αυτόματα.

<iframe src="https://monu.tools/embed/el/image-to-base64" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

Σχετικά εργαλεία