WikiPlus

Obraz do Base64

Konwertuj obrazy na kod Base64 do osadzania w kodzie. 100% za darmo, działa w przeglądarce.

Przetwarzanie lokalne
Średnio 1.4s
4.8 z 5 — na podstawie 1,247 uzyc

Autor: Sergio Robles — Założyciel

Przeciągnij i upuść obraz tutaj

lub kliknij, aby przeglądać pliki

JPG · PNG · WebP · GIF
Twoje pliki są przetwarzane lokalnie w przeglądarce. Nigdy nie przesyłamy ani nie przechowujemy Twoich danych.

Co to jest Obraz do Base64?

Image to Base64 zamienia dowolne PNG, JPG, GIF, WebP, SVG lub BMP na ciag tekstowy, ktory mozesz wkleic. Umiesc go bezposrednio w HTML, CSS, JSON lub wywolaniu REST. Deweloperzy e-mail osadzaja male ikony, ktore wyswietlaja sie nawet gdy Outlook blokuje obrazy. Deweloperzy frontend zmniejszaja liczbe zapytan HTTP, wstawiajac male sprite'y inline. Deweloperzy mobilni dostarczaja dane obrazowe w plikach konfiguracyjnych JSON. Deweloperzy AI przygotowuja obrazy wejsciowe dla API OpenAI lub Gemini. Narzedzie dziala w Twojej przegladarce. Zdjecia produktow i materialy marki nigdy nie opuszczaja urzadzenia. Wynik daje gotowy ciag dla HTML img src, CSS url() lub pol JSON. Dodaje prefiks data:image/png;base64 za Ciebie. Mozesz tez wybrac surowy Base64 bez prefiksu do wywolan API.

Kiedy powinienem użyć tego narzędzia?

  • Osadź małe ikony jako wbudowane data URI w plikach CSS
  • Wklej loga bezpośrednio do kodu HTML szablonów e-mail
  • Dołącz miniaturki wewnątrz odpowiedzi JSON API bez hostowania
  • Prototypuj makiety UI bez konfigurowania serwera obrazów

Jak skonwertować obraz na base64?

  1. 1Prześlij obraz, który chcesz zakodować jako data URI.
  2. 2Poczekaj chwilę, aż przeglądarka odczyta i zakoduje plik.
  3. 3Skopiuj wygenerowany ciąg Base64 z pola wyjściowego.
  4. 4Lub skopiuj gotowy do użycia data:image URI z prefiksem MIME.
  5. 5Wklej ciąg do swojego kodu HTML, CSS lub JSON.

Często zadawane pytania

Dlaczego miałbym chcieć obraz jako ciąg Base64?

Base64 encoding converts binary image data into a printable ASCII text string using a 64-character alphabet. The resulting data URI — formatted as data:image/png;base64,iVBORw0KGgo... — can be embedded directly inside HTML, CSS, JSON, XML, Markdown, and email source code without requiring a separate file or an additional HTTP request. The most common practical applications are: inlining small icons and logos in CSS using the background-image property to eliminate a separate image fetch and reduce the number of HTTP round-trips on first page load; embedding a company logo in an HTML email template, since external image URLs are blocked by default in most email clients including Outlook, Apple Mail, and corporate Microsoft 365 environments; encoding a small avatar or signature image in a JSON API response payload so the client renders it without a follow-up request; and storing small UI assets inside a compiled application binary or a single-file web app. The performance trade-off is important to understand: Base64 encoding inflates file size by approximately 33 percent compared to the raw binary. For images smaller than 2 to 4 kilobytes, the eliminated HTTP request saves more time than the size overhead costs. For images larger than 10 kilobytes, the overhead almost always exceeds the savings. The browser can cache a separate image file across multiple page loads. An inlined Base64 string must be retransmitted with the HTML or CSS document on every request. Reserve Base64 inlining for small, frequently needed assets.

Jakie formaty obrazów mogę zakodować?

WikiPlus Image to Base64 supports encoding of JPEG, PNG, WebP, GIF, BMP, ICO, and SVG files. The output data URI uses the correct MIME type for each format: data:image/jpeg for JPEG files, data:image/png for PNG, data:image/webp for WebP, data:image/gif for GIF including animated GIFs where the full animation is preserved in the encoded string, data:image/bmp for BMP, data:image/x-icon for ICO, and data:image/svg+xml for SVG. Each format has different strengths for Base64 use cases. PNG is the most versatile choice for UI assets: it supports full alpha transparency, uses lossless compression, and is supported in every browser and email client dating back well over a decade. JPEG is best for photographic content where file size matters more than pixel-perfect accuracy. WebP is the most size-efficient modern format but requires browsers released after late 2020, making it unsuitable for HTML email embedding where Outlook on Windows may be a recipient. SVG files can also be used in data URIs in two ways: Base64-encoded as shown, or as URL-encoded plain SVG text using data:image/svg+xml,%3Csvg.... URL-encoded SVG typically produces a shorter string for simple vector graphics because SVG is already text-based XML and encodes more efficiently without the Base64 alphabet restriction. GIF animation is fully preserved in the Base64 output — the entire sequence of frames, timing data, and loop instructions is encoded into the string, so inserting the data URI into an img tag plays the animation identically to a file reference.

Czy jest limit rozmiaru kodowanych obrazów?

WikiPlus Image to Base64 imposes no hard file size limit. The tool uses the browser's FileReader API to read the source file and the btoa function to generate the Base64 string, both subject only to available browser memory rather than an arbitrary cap. On a modern desktop with 8 GB or more of RAM, files up to 50 to 100 MB encode successfully. On a smartphone with 3 to 4 GB of RAM, the practical limit is lower, around 20 to 30 MB, before the tab becomes memory-constrained. These upper limits are far beyond what makes practical sense for Base64 inlining. As a firm rule of thumb, any image larger than 10 kilobytes should not be embedded as a Base64 data URI in a web context. A 10 KB image produces approximately 13.3 KB of Base64 text — a manageable inline asset. A 100 KB image produces roughly 133 KB of text that must be parsed and transmitted with every HTML or CSS document that references it, increasing page weight and eliminating the browser caching benefit that a separate file would provide. The WikiPlus tool displays both the original file size and the encoded output size side by side before you copy the string, making the 33 percent size expansion immediately visible. Use this readout to confirm the encoded size is acceptable before adding the string to your codebase. For any image exceeding 10 KB, a standard file URL reference with a properly configured long-lived Cache-Control header is almost always the better technical choice.

Czy lokalne kodowanie Base64 ma korzyści dla prywatności?

Yes, and they are significant. WikiPlus Image to Base64 runs entirely in your browser using the FileReader API to read the file and the btoa function to perform the encoding. The image content never reaches WikiPlus servers, never touches any third-party API, and is never transmitted in any network request. The encoding process is purely local: your file is read into browser memory as a binary buffer, encoded to a Base64 string in memory, and the resulting string is displayed in the output panel for you to copy. The data remains in your browser tab until you close it, at which point it is released from memory with no persistent copy anywhere outside your device. This matters for categories of images developers commonly encode for technical work. Confidential product mockups and unreleased screenshots need to be embedded in prototype applications before launch. Security audit reports contain screenshots of vulnerability findings that must not be uploaded to external services. Compliance documentation may include ID images or biometric data subject to GDPR, HIPAA, or CCPA restrictions prohibiting third-party cloud processing without explicit consent. Internal tools contain screenshots of financial dashboards or HR systems that fall under data governance policies prohibiting cloud transmission. Server-side Base64 encoding tools receive and process your image bytes on infrastructure you do not control — log files and analytics systems on those servers may capture image metadata or content. With WikiPlus, the encoding never leaves your machine.

Tresc tej strony jest dostepna na licencji CC BY 4.0.