แปลงรูปภาพเป็น Base64 data URI สำหรับฝังใน HTML, CSS หรือ JSON ทั้งหมดในเบราว์เซอร์ของคุณ
วิธีใช้ รูปภาพเป็น Base64
เลือกรูปภาพจากอุปกรณ์ของคุณ
คัดลอก data URI หรือ CSS snippet ที่พร้อมใช้
วางลงใน HTML, CSS หรือ JSON ของคุณ
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.
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 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.
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.
คำถามที่พบบ่อย
ไม่ รูปภาพถูกอ่านทั้งหมดในเบราว์เซอร์ของคุณ ดังนั้นจะไม่ออกจากอุปกรณ์
สำหรับรูปภาพเล็กๆ เช่น icons ที่การหลีกเลี่ยง network request เพิ่มเติมคุ้มกับการเพิ่มขนาด สำหรับรูปภาพขนาดใหญ่ ไฟล์ปกติดีกว่า
การ encode Base64 เพิ่มขนาดประมาณ 33 เปอร์เซ็นต์เพราะแสดงข้อมูล binary โดยใช้ตัวอักษรที่จำกัด
ฝังเครื่องมือนี้
เพิ่มเครื่องมือนี้ลงในเว็บไซต์ของคุณเอง คัดลอกสคริปต์ด้านล่าง โดยจะอัปเดตให้เป็นปัจจุบันโดยอัตโนมัติ
<iframe src="https://monu.tools/embed/th/image-to-base64" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>เครื่องมือที่เกี่ยวข้อง
เข้ารหัสข้อความเป็น Base64 หรือถอดรหัส Base64 กลับเป็นข้อความ ปลอดภัยกับ UTF-8 พร้อมตรวจจับทิศทางอัตโนมัติ
เข้ารหัสและถอดรหัสแบบเปอร์เซ็นต์สำหรับ URL และส่วนประกอบ URL ปลอดภัยกับ UTF-8
ถอดรหัส JSON Web Token เพื่อตรวจสอบส่วนหัวและข้อมูล พร้อมแสดงเวลาหมดอายุและเวลาออกในรูปแบบที่อ่านได้ ทำงานทั้งหมดในเบราว์เซอร์ของคุณ ไม่มีการอัปโหลด token
สร้างแฮช SHA-1, SHA-256, SHA-384 และ SHA-512 ของข้อความใดก็ได้ ในเบราว์เซอร์ของคุณ