Base64 Encoder & Decoder - Encode and Decode Online

Tools / Dev Tools / Base64 Encoder & Decoder

Base64 Encoding / Decoding

Privacy Notice

All encoding and decoding is performed locally in your browser using JavaScript. No input data is sent to any server, stored, or logged. Miracle Salad does not collect or retain any content entered into this tool.

About Base64 Encoding

Base64 turns arbitrary binary data into plain text made of 64 safe characters. That is its entire job. It is not compression — the output is larger, not smaller. And it is not encryption, although it is mistaken for it constantly. It exists because a great many channels can carry text but choke on raw bytes.

How to use this tool

  1. 1 Choose Encode or Decode, then paste your text — or switch to file mode and drop a file in.
  2. 2 The result appears as you type; nothing is uploaded and no button press is needed.
  3. 3 When decoding into a file, type the extension so the preview and download know what they are handling.

Base64 is not encryption

This is the point worth remembering above all others. Base64 has no key and no secret; the transformation is public and reversible by anyone, as this page demonstrates in a single click. Text that merely looks scrambled offers no protection at all. If you find a password, an API key or a token stored as Base64, treat it as if it were written in plain sight — because it is. Use real encryption when the goal is secrecy, and use Base64 only when the goal is safe transport.

Why it exists at all

Many systems were designed for text and only text. Email bodies, JSON payloads, XML documents, URLs and HTML attributes all break when a raw byte happens to look like a control character or a quotation mark. Base64 sidesteps the problem by mapping every possible byte onto a small alphabet of letters, digits and two punctuation marks that survive any of these channels intact. That is why you meet it in email attachments, in data URIs that embed a small icon directly in a stylesheet, and in the middle segment of every JWT.

The price is about a third more

Three bytes of input become four characters of output, so the result is roughly 33% larger than what you started with. For a short token that is irrelevant. For a large image inlined into a stylesheet it is not: the file grows, it cannot be cached separately from the page, and the browser must decode it before it can paint. Inline small assets if it saves a request, keep large ones as ordinary files, and remember that Base64 never makes anything smaller — if size is your problem, compression is the tool you want.

Frequently Asked Questions about Base64

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It converts every 3 bytes of binary data into 4 ASCII characters, increasing size by ~33%. Base64 is not encryption — it provides no security. Its purpose is safe transmission of binary data through text-based channels like email, JSON, or HTML attributes.
New
PDF to Base64 Convert a PDF to Base64 for APIs that expect documents as text: get the raw string, a data URI and an embed snippet, all in your browser.
Popular Today
PDF to Base64 Convert a PDF to Base64 for APIs that expect documents as text: get the raw string, a data URI and an embed snippet, all in your browser.

Related Dev Tools

PNG to Base64 Convert a PNG to Base64 and copy a ready-made data URI, the raw string or a CSS snippet - the image never leaves your browser.
JPG to Base64 Convert a JPG photo to Base64 and copy a data URI, the raw string or a CSS snippet - it also tells you when inlining is a bad idea.
WebP to Base64 Convert a WebP image to Base64 and copy a data URI, the raw string or a CSS snippet - it also explains the fallback you give up.
PDF to Base64 Convert a PDF to Base64 for APIs that expect documents as text: get the raw string, a data URI and an embed snippet, all in your browser.

Other Tools You May Like

Word to PDF Convert Word to PDF for free: upload a DOC, DOCX, ODT or RTF file and download a properly formatted PDF in seconds - no registration or watermark.
PDF to Word Convert PDF to Word for free: upload a PDF and download an editable DOCX in seconds - no registration, no watermark and nothing to install.
Word Counter Free word counter: paste any text to count words, characters, sentences and paragraphs, and see the estimated reading time - nothing leaves your browser.
Character Counter Free character counter: count characters with and without spaces, plus words and lines, and check SEO limits for titles and meta descriptions.
Keyword Density Checker Free keyword density checker: paste text or a URL to see how often each word and phrase appears, with percentages for one, two and three-word terms.