Convert files or images up to 100 MB to Base64 or a data: URL, with img and CSS snippets
Turn an image, PDF or any file into Base64 or a data: URL, ready to paste into HTML, CSS or a JSON request body.
How to use it
Open a file, or drop it on the box. Several files (up to 20) are encoded together, each with its own Copy, and Download saves them as one JSON list. Keep "Data URL" on to get data:image/png;base64,… for use in src or url(). Turn on URL-safe for a value that goes in a URL. Copy the result, or download it as a .txt file. For an image with Data URL on, copy a ready <img> tag or CSS background-image line. With Data URL off, 76-character lines break the Base64 into MIME lines (LF, or CRLF).
Example
Inline a small icon in CSS
Input
icon.png (1.2 KB)
Result
data:image/png;base64,iVBORw0KGgo…
Paste it into CSS as background-image: url("…"), or into an img src.
When a data URL makes sense
Questions
- Is there a file size limit?
Up to 100 MB, for one file or several together; more is not read, which keeps the page quick. The file is read from your disk by the browser and is not sent over the network. - Can I make the image smaller before encoding?
Yes. Under Before encoding, set a width in pixels (the height follows) and a format: PNG, JPEG or WebP, with a quality from 1 to 100 for JPEG and WebP. The image is redrawn in your browser and the new file is encoded; the file panel shows its size. JPEG has no transparency, so transparent parts become white. - Is my data or file uploaded?
No. Everything runs in your browser, so your data stays on your device. Nothing you paste is uploaded unless you share a result, which is locked with your password first. That includes files you open.