How to use File to Base64
- 1. Open a file. Images, PDF, Office docs, audio, video, fonts, and more.
- 2. Copy output. Raw, Data URI, JSON, HTML, or CSS presets.
- 3. Stay private. Bytes never leave this tab.
About this tool
“Base 64 encoder file” searches want binary→Base64 without a CLI. This landing is File encode with broad accept.
Office documents
DOCX, XLSX, and PPTX encode as Base64 like any other binary; decode restores the original extension when magic bytes match.
Code examples
Node
Buffer.from("hello").toString("base64");
Buffer.from(b64, "base64").toString("utf8");Browser (UTF-8 safe)
btoa(unescape(encodeURIComponent(text)));
decodeURIComponent(escape(atob(b64)));Python
import base64
base64.b64encode(b"hello").decode() # aGVsbG8=
base64.b64decode("aGVsbG8=").decode()Data URI
const uri = `data:image/png;base64,${b64}`;
// <img src={uri} /> or CSS url('${uri}')