Base64 Encode / Decode
Encode and decode Base64 for text, files and data URIs.
How to base64 encode / decode
- Type or paste text, or switch to file mode and drop a binary file.
- Choose encode or decode.
- Copy the result, or toggle data-URI format for embedding.
About this tool
Base64 is everywhere in web development precisely because binary data and text-based protocols are an uncomfortable mix. JSON has no binary type, so a certificate, an image embedded in a response, or a serialised object ends up as a Base64 string. Email attachments are encoded as MIME multipart, which is Base64 with line breaks. JWTs carry their payload as Base64URL. Understanding the format takes five minutes; having a tool to convert it quickly is useful for the rest of your career.
The data URI mode is the conversion most relevant to front-end work: it produces the exact string you can drop into an src attribute or a CSS background-image, allowing you to inline small assets without a separate file request. The rule of thumb is to use this for assets under 4–8 KB; above that size, a separate file request with HTTP caching is faster on subsequent loads.