JSON Formatter
Format, validate, minify, or sort JSON data with configurable indentation. Instantly check for syntax errors, view node count and nesting depth — free, no sign-up required.
Encode any text to Base64 (standard, URL-safe, or MIME) or decode any Base64 string back to plain text. Instant, free, no sign-up required.
Base64 Variant
Input
Output
Base64 Encoder / Decoder is part of the Developer collection. If you want a broader view of similar workflows, open the Developer category page or browse all QuickTools categories.
Common next steps after this tool include JSON Formatter, QR Code Generator and UUID Generator.
Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /) plus the = padding character. Originally defined in RFC 2045 for MIME email attachments, it is now used everywhere binary or arbitrary byte data needs to travel safely through text-only channels—HTTP headers, JSON payloads, HTML data URIs, JWTs, and more.
Base64 is not encryption. It is purely an encoding: any computer can decode Base64 without a key. It increases size by roughly 33 % but ensures that characters like null bytes, control codes, and high-byte values are never misinterpreted by text-based protocols.
.txt file.| Variant | Standard (RFC 4648 §4) | URL-safe (RFC 4648 §5) | MIME (RFC 2045) |
|---|---|---|---|
| Characters | A–Z a–z 0–9 + / | A–Z a–z 0–9 − _ | A–Z a–z 0–9 + / |
| Padding | = (required) | None | = (required) |
| Line breaks | None | None | CRLF every 76 chars |
| Use case | General encoding | JWTs, URLs, cookies | Email (MIME) attachments |
HTTP Basic Authentication
Authorization: Basic dXNlcjpwYXNzd29yZA==
The credential "user:password" encoded as standard Base64.
JWT Header
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
URL-safe Base64 (no padding) encoding {"alg":"HS256","typ":"JWT"}.
HTML Inline Image (data URI)
<img src="data:image/png;base64,iVBORw0KGgo…" />
Standard Base64 embeds binary image data directly in HTML.
MIME Email Attachment
Content-Transfer-Encoding: base64 VGhpcyBpcyBhIHRlc3Q=
MIME Base64 breaks output into 76-char CRLF-delimited lines.
Base64 encodes 3 bytes (24 bits) of input as 4 output characters (6 bits each). The 6-bit index into the character table ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ determines each character. When the input length is not a multiple of 3, one or two = padding characters are appended so the output length is always a multiple of 4.
Example: the 3-byte string Man (0x4D 0x61 0x6E) becomes six 6-bit groups 010011 010110 000101 101110, mapping to TWFu. The ≈33 % size overhead (3 bytes → 4 chars) is the inherent cost of Base64 encoding.
Is Base64 the same as encryption?
No. Base64 is an encoding — it has no key and anyone can reverse it. It prevents data corruption in text channels, not unauthorised access. For confidentiality, use AES-256 or TLS.
When should I use URL-safe Base64?
Whenever the encoded string will appear in a URL, query parameter, cookie, or JWT. Standard Base64 uses + and / which are reserved URL characters; URL-safe replaces them with - and _ and removes = padding, making the string safe without percent-encoding.
What is MIME Base64 and when do I need it?
MIME Base64 (RFC 2045) is identical to standard Base64 except the output is split into 76-character lines separated by CRLF ( ). It is required for email attachments and multipart MIME bodies where very long lines can confuse mail servers.
Why does the decoder say 'Invalid Base64'?
The input may contain characters outside the Base64 alphabet, incorrect padding (= count), or be a standard string being decoded as URL-safe (or vice versa). Try switching the variant selector or ensure the entire Base64 block is pasted with no extra spaces at line boundaries.
Can I Base64-encode binary files (images, PDFs)?
This tool works with text input only. For binary files, use a file-based encoder in your language runtime — for example Buffer.from(fileBytes).toString('base64') in Node.js or base64.b64encode(data) in Python.
Does Base64 compress data?
No, it expands it by about 33 %. Base64 is designed for safe transmission, not compression. If size matters, compress first (gzip / brotli) and then Base64-encode the compressed bytes.
Is my data sent to a server?
All encoding and decoding is performed server-side via an API call but nothing is stored or logged. For sensitive data you can run the tool offline or use the Node.js Buffer API locally.
Format, validate, minify, or sort JSON data with configurable indentation. Instantly check for syntax errors, view node count and nesting depth — free, no sign-up required.
Generate QR codes for URLs, text, Wi-Fi credentials, vCards, and more. Customise foreground and background colour, error correction level, margin, and download as SVG or PNG — free and instant.
Generate UUID v1, v4, v5, or Nil identifiers in bulk. Validate any UUID and detect its version. Copy instantly — no signup required.
Generate MD5, SHA-1, SHA-224, SHA-256, SHA-384 & SHA-512 hashes from any text. Supports hex, Base64, and Base64URL output, plus HMAC signing. Free and instant.
Convert short MP4, WebM, MOV, AVI, MKV, and other video clips into GIFs online with trim controls, frame-rate options, and private in-browser processing.
Create animated GIFs from a sequence of images online with per-frame delay, output width, loop count, and private in-browser processing — no upload required.
Convert an animated GIF into a compact MP4 or WebM video file online with output width, duration, and FPS controls — processed entirely in your browser, no upload required.
Convert an animated GIF into a compact WebM video file online using VP9 or VP8 — output width, duration, and FPS controls with private in-browser processing, no upload required.