DevBento logoDevBento
Tools/Base64 Encoder / Decoder

Base64 Encoder / Decoder

Convert audio, PDF, images, and text to Base64 online. Encode files to Base64 strings for APIs, data URIs, and HTML embedding. No upload, runs in browser.

Send to:
Related Conversions
Audio to Base64 Converter: Encode MP3, WAV, OGG
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
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
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
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
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
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 — No Upload, Runs Locally
Convert PDF to Base64 string in your browser. No file upload, no server. Output plain Base64, data URI, or embed code. Works with any PDF size up to 50 MB.
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.
Base64 Size Overhead: Why Encoded Data Is 33%
Base64 encoding expands every 3 bytes of binary data into 4 characters. Explains the 33% overhead, padding rules, and practical impact on storage and transfer.
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.
Base64 vs Base64URL: When to Use Each Encoding
Compare Base64 and Base64URL encodings. Covers the character set differences, URL safety, padding rules, and when each format is required.
WebP to Base64 Converter: Encode WebP Images
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
{}JSON Formatter + Tree Viewer + Graph Visualizer
Paste JSON to pretty-print, minify, validate, or visualize as an interactive graph. Syntax highlighting, tree view, and graph view with export.
jwtJWT Decoder
Decode and inspect JSON Web Tokens in your browser. View the header, payload claims, and expiration status without sending your token to any server.
%20URL Encoder & HTML Entity Encoder
Encode and decode URLs with encodeURIComponent or encodeURI, and escape HTML special characters to named or numeric entities. Runs locally in your browser.
shaHash Generator
Create a checksum of the decoded output

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.

What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data as a string of 64 printable ASCII characters: A-Z, a-z, 0-9, +, and /. It was defined in RFC 4648 and is used whenever binary data needs to be transmitted over channels that only support text, such as email (MIME attachments), HTML/CSS (data URIs for inline images), JSON (embedding binary payloads), and URLs (query parameters containing binary data). Base64 encoding expands data by approximately 33%: every 3 input bytes become 4 Base64 characters. It is not encryption; anyone can decode a Base64 string back to its original form. Its purpose is safe transport, not confidentiality.

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. Need to hash data after encoding? The Hash Generator computes MD5, SHA-1, SHA-256, and SHA-512 digests.

All Base64 Tools

Looking for a specific Base64 task? The Base64 Hub lists every Base64 tool in one place: encode/decode, image/file/audio conversions, CSS backgrounds, data URIs, and more.

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:

🔒

Nothing you paste leaves this tab. Every tool runs entirely in your browser — no upload, no server, no account.

© 2026 devbento.dev · built local-first