Encode file as Base64
Turns any file into Base64 text or a data URL for HTML, CSS and JSON.
Runs in your browser – your file is never uploaded
Frequently asked questions
Is my file uploaded?
No. The conversion runs entirely in your browser. The file never leaves your device – there is no server that could see it. Once the page has loaded, the tool even works offline.
What is a data URL and when do I need one?
A data URL embeds the file directly in HTML, CSS or JSON: “data:image/png;base64,iVBOR…”. Paste it into an <img src>, a CSS url(…) or a JSON field and no separate file request is needed. Useful for small icons and inline previews.
Why is the output larger than the file?
Base64 stores 3 bytes as 4 characters, so the text is about 33 % bigger than the file. That is fine for small icons; for large images it is usually better to link the file.
What is the line wrap for?
E-mail (MIME) and PEM certificates expect Base64 in lines of 76 characters. Leave it off for data URLs and JSON, where the string must stay unbroken.
Related tools
File hash (SHA-256)
Calculates the SHA-256, SHA-1, SHA-384 or SHA-512 checksum of any file.
● In your browser
Decode Base64 to a file
Turns Base64 text or a data URL back into the original file.
● In your browser
View EXIF data
Shows camera, GPS, IPTC and XMP metadata of a photo as readable JSON.
● In your browser
QR code generator (PNG)
Turns a link or text into a QR code image – in your browser.
● In your browser