Image to Base64
画像をBase64データURIに変換。CSS・HTML・JSONで使用可能。
How to Use the Image to Base64 Converter
This free online tool converts any image file to a Base64-encoded data URI string directly in your browser. Simply upload an image (JPEG, PNG, WebP, SVG, GIF, or BMP), and the tool instantly generates the corresponding data URI. You can then copy the result with one click for use in HTML, CSS, JavaScript, or JSON files. All processing happens client-side, so your images are never uploaded to any server.
What Is a Base64 Data URI?
A Base64 data URI is a way to embed binary file data directly in text-based formats. It uses the format data:[mime-type];base64,[encoded-data]. For images, this allows you to include the entire image inline in an HTML document, CSS stylesheet, or JSON payload without needing a separate image file. The browser decodes the Base64 string and renders the image just like a regular file reference.
When to Use Base64 Images
Base64 encoding is ideal for small images like icons, logos, and UI elements (typically under 10KB). Embedding these inline eliminates extra HTTP requests, which can improve page load performance. It is also useful for email templates where external image links may be blocked, and for single-file HTML applications. However, Base64 encoding increases the data size by approximately 33%, so it is not recommended for large photographs or images where file size is critical.
Size Considerations
The Base64 string is roughly 33% larger than the original binary file. For example, a 10KB image becomes approximately 13.3KB when Base64-encoded. The tool displays both the original file size and the resulting string length so you can evaluate whether inline embedding is appropriate for your use case. For large images, consider using the Image Compressor to reduce file size before converting to Base64.
Image to Base64の使い方
このツールは画像ファイルをBase64エンコードされたデータURIに変換します。JPEG、PNG、WebP、SVG、GIFなどの画像をアップロードすると、即座にデータURIが生成されます。HTML、CSS、JavaScriptやJSONファイルにインライン画像として埋め込む際に便利です。すべての処理はブラウザ内で完結します。
開発をもっと効率的に
PR