Base64 encode or decode

Encode text or any file to Base64, or decode Base64, Base64URL and data URIs. If it decodes to a picture or a file, you see it and can save it.

Drop your file here

or click to browse

All files • or paste with ⌘V
Nothing has left this page since you opened the tool. Show network activity

    The browser enforces this: the site’s security policy only lets the page talk to the code libraries’ servers and an anonymous usage counter (tool name, file type, size range). A request carrying your file to anywhere else would be blocked before it left.

    Check it yourself: open your browser’s developer tools, go to the Network tab, and run the tool. Or turn off Wi-Fi once the tool has loaded; it keeps working.

    How it works

    Encode text or any file to Base64, or decode Base64, Base64URL and data URIs. If it decodes to a picture or a file, you see it and can save it.

    Type or paste on the left and the result appears on the right as you type. Encoding uses UTF-8, so accents, Indian scripts and emoji survive the round trip. Turn on URL-safe for Base64URL (the kind used in JWTs and web addresses), or wrap lines at 76 characters for email. Drop any file on the page to encode it, optionally as a ready-to-paste data URI. Decoding is forgiving: spaces and line breaks, URL-safe characters, missing padding and a data: prefix are all fine, and when something is wrong you are told which character and where. When the decoded result is a picture (PNG, JPEG, GIF, WebP, SVG) it is shown, and other files such as PDFs and ZIPs are recognised and can be downloaded. Swap sends the result back as the input, the other way round, and if you paste Base64 while encoding it offers to decode it instead. Everything runs in your browser; nothing is uploaded.

    How to use it

    1. Choose Encode or Decode. Or drop a file to encode it.
    2. Paste or type. The result appears as you type.
    3. Copy or download. Copy the text, or save a decoded file.

    Frequently asked questions

    How do I decode Base64?
    Choose Decode and paste the Base64. Text appears straight away; a picture or file is shown and can be downloaded.
    Does it handle Unicode and emoji?
    Yes. Text is encoded as UTF-8, so any language and emoji decode back exactly.
    What is URL-safe Base64?
    Base64URL swaps + and / for - and _ and drops the = padding, so it can sit in a web address or a JWT. Decoding accepts both kinds.
    Can I convert a Base64 string back to an image or PDF?
    Yes. Paste it (with or without the data: prefix) in Decode; images are previewed, and any file can be downloaded with the right extension.
    Is my data uploaded?
    No. Encoding and decoding happen on this page.
    Saved