Base64 encode · decode · file ↔ data URI
Convert text to Base64 and back, turn a file or image into Base64 (a data URI), or restore a Base64 string to a file. Text is handled as UTF-8 and the URL-safe variant is supported.
🔒 What you type is never sent anywhereText ↔ Base64
File → Base64 (data URI)
Base64 → file
Shrink images with compress image before embedding them as Base64 and your HTML stays light. To check a file has not changed use file hash; to tidy a value inside JSON use the JSON formatter.
Base64 is not encryption
Base64 is a notation that writes bytes with 64 characters (A–Z, a–z, 0–9, + and /). Anyone can reverse it, so it hides nothing. It exists for places that can only carry text and still need to hold a file: small images inside HTML and CSS (data URIs), email attachments (MIME), files inside JSON, parts of API tokens. The output is about 33% larger than the input, so it is the wrong tool for big files. Text is converted to UTF-8 bytes first, which is why the result matches other tools and accented or non-Latin characters survive the round trip.
URL-safe and line breaks
The + and / of standard Base64 have meanings in a URL and get mangled. The URL-safe variant replaces them
with - and _ and drops the trailing =; JWT tokens and values in query strings use it. Email (MIME) breaks lines every 76 characters.
When decoding, any variant is accepted and line breaks and spaces are ignored. If the input is not Base64 at all — a forbidden character or an impossible length — the page
tells you where the problem is.
Why it runs in the browser — what people paste here is tokens, credentials and internal files. Nothing is transmitted; the page works offline and leaves nothing behind.
Frequently asked questions
Is my input sent anywhere?
No. Conversion happens in your browser only; it works with the internet switched off. Tokens and internal files you paste are not stored anywhere.
Decoded text contains garbled characters
The Base64 probably encodes bytes in an encoding other than UTF-8, or it is not text at all. The page decodes as UTF-8 and warns when the bytes are not valid text. Use "Base64 → file" to save the bytes and open them with the right program.
How do I put a data URI in HTML?
For an image, <img src="data:image/png;base64,…">; in CSS, background-image: url("data:…"). Pick that output form and copy it as is. Good for icons of a few kilobytes; large pictures are better kept as files.
How is the file type detected when restoring?
From the MIME type in a data URI, or otherwise from the first bytes (PNG, JPEG, GIF, PDF, ZIP, WebP, SVG). If it cannot be determined the file is saved as .bin — give it a name with the right extension.
Does it work with large files?
Up to tens of megabytes, though the text boxes get slow. Base64 was never meant for large files; under 5MB is recommended.