Base64 Encode/Decode

Encode and decode Base64 strings online. Handles UTF-8 text, emoji, and binary data with full round-trip support. No server, no signup.

100% client-side. Your data never leaves your browser.

Converters & Examples

Audio to Base64 Converter: Encode MP3, WAV, OGG Online

Convert audio files (MP3, WAV, OGG, FLAC, M4A) to Base64 strings for embedding in HTML, APIs, or data URIs. 100% client-side, no server upload.

Base64 to File Converter: Decode Base64 to Any File

Decode a Base64 string to a downloadable file. Auto-detects format from content signature. Works with images, PDFs, audio, and any binary file. Client-side.

Base64 to Image Converter: Decode Base64 to Image Online

Decode a Base64 string to a viewable and downloadable image. Supports JPEG, PNG, GIF, WebP, SVG, and BMP. Preview before download, 100% client-side.

Base64 to PDF Converter: Decode Base64 to PDF Online

Decode a Base64 string to a downloadable PDF file. Handles raw Base64 and data URIs. No server upload, runs entirely in your browser.

CSS Background Image Base64 Generator

Convert images to CSS background-image declarations with Base64 data URIs. Copy-paste ready CSS for inline backgrounds. No server upload, 100% client-side.

Data URI Generator: Create data: URLs from Files

Generate data URIs from any file for inline HTML/CSS embedding. Supports images, PDFs, fonts, and more. Includes MIME type detection. 100% client-side.

File to Base64 Converter: Encode Any File Online

Convert any file to a Base64 string. Works with documents, images, audio, archives, and any binary format. 100% client-side, no file upload to servers.

GIF to Base64 Converter: Encode GIF Images Online

Convert GIF images and animations to Base64 strings. Embed animated GIFs as data URIs in HTML or CSS. No upload required, runs in your browser.

Image to Base64 Converter: Encode Any Image Online

Convert images (JPG, PNG, SVG, WebP, GIF) to Base64 strings. Get plain Base64, data URIs, or CSS background snippets. No upload, runs in your browser.

JPG to Base64 Converter: Encode JPEG Images Online

Convert JPG and JPEG images to Base64 strings. Get data URIs for HTML img tags, CSS backgrounds, or raw Base64 for APIs. Runs locally in your browser.

PDF to Base64 Converter: Encode PDF Files Online

Convert PDF files to Base64 strings for API payloads, database storage, or inline embedding. No upload, the conversion runs entirely in your browser.

PNG to Base64 Converter: Encode PNG Images Online

Convert PNG images to Base64 strings with transparency preserved. Output as data URI, CSS background, or raw Base64. 100% client-side, no upload.

SVG to Base64 Converter: Encode SVG Images Online

Convert SVG images to Base64 data URIs for CSS backgrounds and HTML embedding. Preserves vector quality at any scale. Runs locally, no server upload.

WebP to Base64 Converter: Encode WebP Images Online

Convert WebP images to Base64 strings. Get data URIs for HTML embedding or CSS backgrounds with smaller file sizes than PNG/JPEG. 100% client-side.

Related Tools

Base64 Encode and Decode Online

Base64 is a binary to text encoding that represents any data (text, images, binary files) as a string of printable ASCII characters. Paste text to encode it, or paste a Base64 string to decode it back. Everything runs locally in your browser.

How to Use

  1. Paste or type your text into the input field
  2. Select a mode: Auto (detects whether to encode or decode), Encode, or Decode
  3. Copy the result from the output field using the Copy button

How Base64 Works

Base64 encoding converts binary data into a text representation using 64 printable ASCII characters. The encoding process takes every 3 bytes (24 bits) of input and splits them into 4 groups of 6 bits. Each 6-bit value maps to one of 64 characters: A-Z, a-z, 0-9, +, and /. If the input length is not a multiple of 3, padding characters (=) are added.

This encoding is commonly used for embedding images in HTML/CSS via data URIs, encoding email attachments (MIME), transmitting binary data in JSON or XML payloads, and storing complex data in URL parameters or cookies.

UTF-8 Support

This tool fully supports UTF-8 text, including emoji, CJK characters, and other multibyte Unicode. The input text is first encoded to UTF-8 bytes using the TextEncoder API before Base64 encoding, ensuring correct round trip conversion for any language or symbol set.

JWTs use a variant called Base64URL that swaps +/ for -_ and drops padding. The JWT Decoder handles that automatically. If you need to encode special characters for URLs instead of binary transport, the URL Encoder uses percent encoding, which is the standard for query parameters and path segments.

File and Image Conversion

This tool handles text input. To convert files and images to Base64, use the dedicated converters below. They support drag and drop, image preview, and output as plain Base64, data URIs, or CSS background declarations: