Base64 Encoder & Decoder - Encode and Decode Online

2on /
/ 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 accept documents as text. Get the raw string, a data URI and an HTML embed snippet - all in your browser, nothing uploaded.
Popular Today
PDF to Base64 Convert a PDF to Base64 for APIs that accept documents as text. Get the raw string, a data URI and an HTML embed snippet - all in your browser, nothing uploaded.

Related Dev Tools

PNG to Base64 Convert a PNG to Base64 and get a ready-to-paste data URI, the raw string and a CSS snippet. Runs entirely in your browser - the image is never uploaded.
JPG to Base64 Convert a JPG or JPEG photo to Base64 and get a data URI, the raw string and a CSS snippet. Runs in your browser - and tells you honestly when inlining is the wrong choice.
WebP to Base64 Convert a WebP image to Base64 and get a data URI, the raw string and a CSS snippet. Runs in your browser - and explains the fallback you give up by inlining.
PDF to Base64 Convert a PDF to Base64 for APIs that accept documents as text. Get the raw string, a data URI and an HTML embed snippet - all in your browser, nothing uploaded.

Other Tools You May Like

Word to PDF Convert Word to PDF online for free. Upload a DOC, DOCX, ODT or RTF file and download a perfectly formatted PDF in seconds - no registration and no watermark.
PDF to Word Convert PDF to Word online for free. Upload a PDF and download an editable DOCX file in seconds - no registration, no watermark and nothing to install.
Word Counter Free online word counter tool. Count words, characters, sentences, paragraphs, reading time and more instantly.
Character Counter Online character counter. Count characters with and without spaces, words, and lines. Check SEO limits for meta descriptions, titles, and social media posts.
Keyword Density Checker Online keyword density checker. Analyze keyword frequency and percentage in any text or URL. Optimize your content for SEO with accurate keyword density analysis.