Base64 Encoder / Decoder
Encode & decode text and files (PDF, images, audio, video) with file preview, data URI support, and multiple encoding variants — entirely in your browser.
Related Articles
Learn more about this topic
Related Tools
You might also find these useful
Everything you need to know
What is Base64?
Base64 is a binary-to-text encoding that represents binary data using 64 ASCII characters. It's used extensively in web development for embedding images in CSS/HTML, transmitting data in APIs, encoding email attachments (MIME), and storing binary data in JSON or XML.
Encode Any File to Base64
Drag and drop or browse to upload any file — PDFs, images (PNG, JPG, GIF, WebP, SVG), audio (MP3, WAV, FLAC, OGG), video (MP4, WebM), ZIP archives, fonts, JSON, and any other file type. The tool reads the file entirely in your browser, converts it to Base64, and shows the output with file metadata and a live preview for supported media types. Encode multiple files at once in batch mode.
Decode Base64 to Downloadable File
Paste any Base64 string (or a full data: URI) and the tool auto-detects the file type from magic bytes. It renders inline previews for images, PDFs (via embedded viewer), audio players, and video players. Download the decoded file with a single click.
Encode Text to Base64
Paste any text — including Unicode, emojis, and special characters — and get the Base64-encoded output instantly. Supports standard, URL-safe, and MIME encoding variants with optional data URI wrapping.
Encoding Variants
Standard (RFC 4648) uses A-Z, a-z, 0-9, +, / with = padding. URL-Safe replaces + with - and / with _ and strips padding — ideal for URLs, filenames, and JWTs. MIME (RFC 2045) wraps output at 76 characters per line — standard for email attachments and PEM certificates.
Data URI Generation
Toggle the Data URI option to wrap the Base64 output in a data:<mime>;base64,… string, ready to paste directly into HTML <img> tags, CSS url(), or JavaScript.
Privacy
All encoding and decoding happens entirely in your browser using native Web APIs. No files or data are uploaded to any server.
Related Tools
Generate secure hashes with the Hash Generator, encode URLs with the URL Encoder, or format API responses with the JSON Formatter.