Image to Base64 Online — Data URI in Browser
Convert a local image (PNG, JPEG, GIF, WebP, SVG) to Base64 or a data URI. 2 MiB limit — nothing is uploaded.
How conversion works
Pick a PNG, JPEG, GIF, WebP, or SVG file (max 2 MiB). Choose data URI or raw Base64. Preview renders via an img element — SVG is never injected into the DOM as markup.
Options
Examples
Data URI
Input
Output shape
Raw Base64
Input
Output shape
Related tools
For text Base64 use base64. For SVG-specific data URIs see svg-to-data-uri.
Image to Base64 FAQ
Limits & formats
What is the size limit?
2 MiB. Larger files are rejected — there is no unlimited upload.
Why does Base64 expand size?
Base64 expands binary data by about 33%. Prefer files or CDN URLs for production assets.
Is SVG preview safe?
Preview uses only an img with a data URI — never inline SVG DOM injection.
Looking for converters, encoders, formatters, and minifiers in one place? Developer tools hub Open the curated developer tools catalogue.