<!-- Markdown version of https://ocxly.com/base64.html · auto-generated, may lag the live page -->

# Base64 Encoder / Decoder

Encode plain text or binary files to Base64, decode Base64 strings back to readable text — instantly, client-side only. Your data never leaves your browser.

## Encode a File to Base64

### Base64 Explained

Base64 encodes binary data as ASCII text using 64 printable characters: `A–Z`, `a–z`, `0–9`, `+` and `/`. Every 3 bytes of input become 4 characters of output, adding roughly 33% overhead. The `=` character is used for padding.

### Where It's Used

Embedding images in HTML/CSS as `data:` URIs, encoding binary content in JSON payloads, MIME email attachments, HTTP Basic Auth headers (`user:pass`), and JWT token payloads are all Base64 encoded.

### URL-Safe Mode

Standard Base64 uses `+` and `/` which have special meaning in URLs. URL-safe Base64 (RFC 4648 §5) replaces them with `-` and `_` and omits `=` padding — safe for query strings and JWT tokens.

## Accessibility

### Screen reader support

---
*Source: [ocxly.com/base64.html](https://ocxly.com/base64.html) — OCXLY, free 100% client-side privacy-first tools. Free Base64 encoder and decoder. Encode plain text or files to Base64, decode Base64 strings, with URL-safe mode and live conversion. Built by OCXLY AI Labs.*
