Image to Base64
Encode an image as a Base64 data URI, ready to paste into HTML or CSS.
Image
Base64
- Data URI
Choose an image - Base64 only
Choose an image - HTML
Choose an image - CSS
Choose an image
Missing a feature or found a bug in Image to Base64? Tell me on X (@_andrewtran) or by email.
How to use Image to Base64
- Drop an image on the page, or choose one from your device.
- Pick the form you need: data URI, plain Base64, HTML or CSS.
- Copy it with the Copy button.
Questions and answers
Is my image uploaded?
No. The image is read by your browser, on this device. Nothing is sent to a server.
When should I inline an image?
For small icons and backgrounds, where saving a request matters. Base64 is about a third larger than the file, so large images are better kept as files.
Which formats work?
Any image your browser can open, including PNG, JPG, GIF, WebP, AVIF and SVG.
Related tools
Colour converter
Pick a colour and convert it between HEX, RGB, HSL, HSV and OKLCH.CSS clamp() generator
Build a CSS clamp() for fluid font sizes and spacing that scale between two screen widths.Unicode character inspector
See the code point, type, UTF-8 bytes and UTF-16 units of every character in a piece of text.User agent parser
Read the browser, engine, operating system and device type from any user agent string.