Base64 Encoder / Decoder
Encode text or upload files to Base64 (raw, Data URL, img tag, CSS url), or decode Base64 strings with live image previews and file downloads.
Last updated November 12, 2026
Loading tool workspace…
Overview
Encodes text strings or local files into Base64 (standard or RFC 4648 URL-safe) and decodes Base64 payloads back to UTF-8 text or binary files. Includes instant output formatting (Data URL, HTML <img> tag, CSS url()), live image previews for decoded graphic payloads, and one-click JSON formatting.
How it works
Base64 maps binary data onto 64 printable ASCII characters, transforming each 3-byte chunk into 4 6-bit characters. The encoder uses modern TextEncoder bytes to preserve multi-byte UTF-8 emojis and non-Latin scripts. In URL-safe mode, '+' becomes '-' and '/' becomes '_' while trailing '=' padding is stripped. The decoder automatically restores missing padding, translates URL-safe alphabets, and detects image magic numbers (PNG, JPEG, GIF, WEBP) to render live canvas previews.
How to use the Base64 Encoder / Decoder
Select Mode
Choose Encode or Decode tab.
Input Text or Upload File
Type/paste text or upload a local file directly from your computer.
Format & Export
Choose Raw string, Data URL, HTML <img>, or CSS url(), preview decoded images, and copy or download.
When to use it
- Embedding small icons, SVGs, and favicons directly into HTML or CSS without extra HTTP requests.
- Inspecting and decoding Base64 tokens, Basic Authentication headers, or API responses.
- Converting local binary images into shareable Data URLs without uploading to an external host.
Examples
Text to Base64
Hello, world!
SGVsbG8sIHdvcmxkIQ==
The two '=' characters represent padding to complete the 4-character block.
Image Data URL
1x1 transparent PNG
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=
Directly consumable in CSS background-image: url(...) or HTML <img src='...'>.
Key Features & Accuracy
Upload images, SVGs, or files to immediately produce Base64 strings or ready-to-use Data URLs.
Automatically renders decoded PNG, JPEG, GIF, and WEBP payloads with instant file download.
RFC 4648 §5 compliance replacing + and / with - and _ for safe query param and JWT payload transmission.
Limitations & important notes
Frequently Asked Questions
Related Tools
Developer UtilitiesURL Encoder / Decoder
Percent-encode and decode URLs and URI query parameters according to RFC 3986 standards.
JSON Formatter & Validator
Prettify, minify, and validate nested JSON payloads with accurate syntax error line & column highlighting.
Hash Generator
Generate SHA-1, SHA-256, SHA-384 and SHA-512 checksums of any text using the browser's native Web Crypto API.
Guides
TaskKit never records, stores, or transmits the contents of your tool workspaces. Your data stays securely on your machine.

