Free tool · Developer utilities
Base64 encode and decode
Encode text or a file to Base64, or decode Base64, Base64URL and data URIs back to text or a file.
Runs in your browser. Nothing you paste is uploaded.
About this tool
Base64 encode and decode: how it works
Base64 shows up everywhere in support and API work: Basic auth headers, email attachments, webhook payloads, images inlined as data URIs. This tool encodes and decodes as you type.
Decoding is forgiving. It accepts standard Base64 and URL-safe Base64URL, ignores line breaks, adds missing = padding and strips a data: prefix. If the result is not valid UTF-8 text, it tells you it is binary and lets you download it instead of showing garbage. Images in a data URI are previewed.
To encode a file, select File. Turn on Data URI to get a string you can drop into an img tag or CSS. Expect the output to be about a third larger than the file.
What it does
- UTF-8 safe, emoji and accents included
- URL-safe Base64URL output without padding
- Encode any file, or output a data URI
- Decodes binary data to a downloadable file
- Swap input and output in one click
Building on Ticketdesk?
Automate tickets, AI agents and inboxes from your own code.
FAQ
Base64 encode and decode: common questions
Is Base64 encryption?
No. Base64 is an encoding, anyone can decode it. Never use it to hide passwords or API keys. To look inside a token that uses Base64URL, use the JWT decoder.
What is the difference between Base64 and Base64URL?
Base64URL replaces + with - and / with _, and usually drops the = padding, so the result is safe in URLs and file names. JWTs use it. Decoding here accepts both.
Can I convert a file or image to Base64?
Yes. In Encode mode select File and pick any file. The file is read locally and never uploaded. Turn on Data URI to get the data:image/png;base64,... form.
How do I build a Basic auth header?
Encode username:password, then send Authorization: Basic <encoded value>. The sample shows the format.