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.
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
- Paste or type your text into the input field
- Select a mode: Auto (detects whether to encode or decode), Encode, or Decode
- 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.
PDF to Base64
Convert a PDF file to a Base64 string for API payloads, database text columns, or email attachments sent through providers like SendGrid or SES. Drop the file in PDF to Base64 and copy plain Base64, a data URI, or ready embed HTML. Files stay in your browser.
Audio to Base64
Turn MP3, WAV, OGG, FLAC, or M4A into a Base64 string for HTML audio elements, JSON config, or offline web apps. Drop the clip in Audio to Base64 and copy plain Base64 or a data URI. Short clips under 100 KB embed well, larger files are better served as separate URLs.
Base64 to PDF
Paste a Base64 string to decode it back into a downloadable PDF for verification or recovery after API transport. Use Base64 to PDF to preview the output before saving. For images, use Base64 to File instead.
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:
- Image to Base64: convert any image (JPG, PNG, SVG, WebP, GIF)
- PDF to Base64: encode PDFs for APIs and database storage
- File to Base64: encode any file type
- Base64 to Image: decode and preview Base64 image strings
- Base64 to File: decode Base64 back to downloadable files
- CSS Background Image: generate ready to paste CSS with inline images
- Data URI Generator: create data: URLs from any file
- SVG to Base64: encode SVG images for CSS backgrounds and HTML embedding
Nothing you paste leaves this tab. Every tool runs entirely in your browser — no upload, no server, no account.