File to Base64
Turn a file into Base64
Encode and decode Base64, UTF-8 safe, or turn a file into a data URI.
Free, private, no sign-up
Was this tool helpful?
Suggest an improvementEncode and decode Base64
Choose Encode text and type or paste: the Base64 appears as you type. Choose Decode
and paste Base64 to get the text back. File to Base64 turns any file, such as an image or a font,
into Base64 or a ready-to-use data: URI for HTML and CSS.
Accents and emoji work
Text is encoded as UTF-8, so héllo ✓ round-trips exactly. Tools built on the browser's
btoa fail or garble anything outside basic Latin characters.
Good to know
Is my data uploaded anywhere?
No. Encoding and decoding run in your browser, and files are read locally.
What is URL-safe Base64?
A variant (often called base64url) that uses - and _ instead of + and / and drops the = padding, so it can sit in URLs and JWTs. The decoder accepts both.
Why does my Base64 decode to a file instead of text?
Because it holds binary data, such as an image or a PDF, not text. You can download it, and common image types are previewed.
Is Base64 encryption?
No. It's an encoding anyone can reverse. Never use it to hide passwords or secrets.