Base64 Encoder and Decoder

Encode or decode Base64. Text or files.

Encode and decode Base64 for text and files

Base64 turns binary data into a plain-text string built from 64 safe characters, which is why you see it everywhere: data URLs in CSS, attachments in email, basic auth headers, and binary blobs stuffed into JSON. This free Base64 encoder and decoder converts in both directions, handles full UTF-8 text correctly (accents, emoji, and non-Latin scripts survive the round trip), and works on files up to 5 MB as well as text.

The conversion runs entirely in your browser using the native encoding APIs, so whatever you paste or upload never leaves your machine. That matters because Base64 strings often contain credentials, tokens, or private documents — pasting them into a tool that ships them to a server defeats the point.

In file mode you can encode an image, PDF, or any other file and optionally prepend the data URL prefix (data:mime;base64,...) so the result drops straight into an img tag or CSS background. Going the other way, paste a Base64 string, set a filename and MIME type, and download the decoded bytes as a real file. It is the quickest way to recover an attachment from a raw API payload or inspect what a mystery Base64 blob actually contains.

How to encode or decode Base64

  1. Choose Encode or Decode

    Use the first set of tabs to pick the direction: Encode turns text or a file into Base64, Decode turns Base64 back into the original data.

  2. Pick Text or File

    The second set of tabs switches the input type. Text mode converts as you type; File mode accepts uploads up to 5 MB.

  3. Enter your input

    Paste text or Base64 into the input box, or choose a file from disk. For file encoding, tick Include data URL prefix if you want a ready-to-use data URL.

  4. Copy or download the result

    Use Copy to grab the converted text. When decoding to a file, set the Filename and MIME type, then click Download file to save the decoded bytes.

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding, not encryption — anyone can decode it instantly with no key. Never use Base64 to protect secrets; it only makes binary data safe to transmit as text.

Why is my decoded Base64 output garbled?

Usually the original data was not text, or it was text in an encoding other than UTF-8. This tool decodes text as UTF-8; if the data is actually a file, switch to File mode and download the bytes instead.

How much bigger does Base64 make my data?

Base64 output is roughly 33 percent larger than the input, because every 3 bytes of data become 4 encoded characters plus possible padding.

What is a Base64 data URL?

A data URL embeds a file directly in a string, in the form data:mime/type;base64,XXXX. Browsers can render it inline, so it is commonly used for small images in CSS or HTML without a separate HTTP request.

Is it safe to paste sensitive data into this tool?

Yes. Encoding and decoding happen entirely in your browser with the built-in btoa and atob APIs, and neither your text nor your files are uploaded anywhere.

What is the difference between Base64 and Base64URL?

Base64URL replaces + with - and / with _ so the string is safe inside URLs and filenames, and usually drops the = padding. JWTs use Base64URL, which is why a standard decoder can choke on them without preprocessing.

Encoding URLs the modern way.

ReSlug short links handle all encoding transparently. No more wrestling with Base64 in query strings.

Create a free account