Encode or decode text, or convert a file to a Base64 data URI
A tool for converting text to and from Base64, and for turning an uploaded file into a Base64 data URI — all running in your browser, with nothing sent to a server.
Choose Encode or Decode.
Type or paste your text.
Copy the result — it updates as you type.
Use the file picker below the text tool to convert any file into a Base64 data URI — the output
includes the correct data:<mime-type>;base64, prefix, ready to paste directly into HTML,
CSS, or JSON.
Base64 takes binary data 3 bytes at a time and re-represents it as 4 characters from a 64-character alphabet (A–Z, a–z, 0–9, + and /) — which is why encoded output is always about 33% longer than the original. It's a way to make any data safe to put somewhere that only expects plain text, not a way to shrink or protect it.
Some formats and transport methods, like older email systems, JSON payloads, or URLs, can't safely carry arbitrary binary bytes. Base64 re-encodes that binary data using only plain, safe ASCII characters, so it survives being embedded in text-only formats without corruption.
A common use: converting a small icon or image into a data URI so it can be embedded directly inside
HTML or CSS (background-image: url(data:image/png;base64,...)) instead of requiring a
separate image request — handy for small assets in emails or self-contained config files.
Swap Input/Output moves the result back into the input box and flips the mode, so you can immediately decode what you just encoded. Copy Output grabs the result to your clipboard, and Clear resets both boxes in one click.
No. Base64 is an encoding, not encryption — it has no secret key and provides no security. Anyone can decode a Base64 string back to the original data in seconds, so it should never be used to hide sensitive information.
Not with this tool. It converts a file into a Base64 data URI, but it doesn't take a Base64 string and turn it back into a downloadable file.
Yes. Text is encoded and decoded through the browser's TextEncoder/TextDecoder, so UTF-8 characters, accents, and emoji round-trip correctly instead of breaking on anything outside plain ASCII.
No hard limit is enforced, but the whole file is read into your browser's memory as a data URI, so very large files may be slow or use a lot of memory.
No. Both text and file encoding happen entirely in your browser using JavaScript. Nothing you type or upload here leaves your device.
Embedding a small file, most often an image, directly inside HTML, CSS, or JSON as text instead of linking to a separate file — useful for icons, inline images in emails, or config files that need to be self-contained.