🇺🇸 English
🇪🇸 Español
🇧🇷 Português
🇫🇷 Français
🇩🇪 Deutsch
🇮🇹 Italiano
🇨🇳 中文
🇷🇺 Русский
🇯🇵 日本語
🇰🇷 한국어
🇳🇱 Nederlands
🇮🇳 हिन्दी

Base64 Encoder Online

Encode text, files, and images to Base64 instantly — UTF-8 perfect, Base64URL safe, up to 100MB, and 100% private in your browser.

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters: A–Z, a–z, 0–9, plus (+) and slash (/), with equals (=) used for padding. The name "Base64" comes from the fact that each Base64 digit represents exactly 6 bits of data, and 2^6 = 64.

Base64 is not encryption — it is a reversible encoding designed to safely transmit binary data over channels that only support text, such as email (MIME), JSON payloads, XML documents, and HTTP headers. Anyone can decode a Base64 string without a key or password.

Common use cases include embedding images in CSS and HTML as Data URIs, encoding binary attachments in email (MIME), transmitting binary data in JSON and XML APIs, and encoding credentials in HTTP Basic Authentication headers.

? Encodes each line of text independently. Useful for multiple separate entries.
? Breaks the output into 76-character lines as defined by RFC 2045 / MIME specification.
? Replaces + with -, / with _, and removes = padding. Useful for URLs and filenames (RFC 4648).
LIVE

Encode a file to Base64

Drop your file here, or click to browse

Maximum file size: 100MB

Download encoded file

How to Encode Text to Base64 Online

Using encodeb64.com is straightforward: paste your text into the input field, select your character set (UTF-8 is correct for most modern text), and click Encode. The Base64 output appears instantly in the result field, ready to copy.

For special use cases, the advanced options let you control the output format. Enable URL-safe encoding (Base64URL) to get output safe for JWT tokens and URL parameters. Enable MIME line splitting to wrap the output at 76 characters per RFC 2045. Enable per-line encoding to encode each line of your input independently.

All encoding happens entirely in your browser using JavaScript's TextEncoder API and btoa() function. No data is ever transmitted to a server. This makes encodeb64.com safe for encoding sensitive data like API keys, credentials, or private configuration values.

Base64URL Encoding for JWT Tokens

Standard Base64 uses the characters + and / which are not safe in URLs — they must be percent-encoded as %2B and %2F, making strings longer and harder to read. Base64URL (RFC 4648 §5) solves this by replacing + with - and / with _, and omitting the = padding character entirely.

JWT (JSON Web Tokens) use Base64URL encoding for their header and payload sections. If you are working with JWTs, make sure to select the "URL-safe encoding (Base64URL)" option before encoding, or the resulting string will not be valid for use in Authorization headers or URL query parameters.

Base64URL is also used in OAuth 2.0 PKCE challenges, file names in cloud storage systems, and any context where the Base64 string needs to be embedded in a URL without additional encoding.

Encode Files and Images to Base64

Beyond text encoding, encodeb64.com supports encoding any file type to Base64 — documents, images, audio files, and binary data up to 100MB. Drag and drop your file onto the upload zone, or click to browse. The encoding happens entirely in your browser using the FileReader API, so your file never leaves your device.

For images specifically, the Image to Base64 converter supports JPG, PNG, GIF, WebP, SVG, BMP, ICO, TIFF, and AVIF formats. It outputs five different formats: raw Base64, Data URI (for use in HTML src attributes), CSS background-image syntax, a complete HTML img tag, and Markdown image syntax. A live preview rendered from the Base64 output itself confirms the encoding worked correctly.

Embedding images as Base64 is useful for HTML emails where external image hosting is unreliable, for single-file HTML documents that need to be self-contained, and for CSS stylesheets where a small icon or background needs to be inlined to reduce HTTP requests.

Frequently Asked Questions

What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is used in JWT tokens, CSS image embedding, email attachments (MIME), API authentication, and webhooks.
Is Base64 safe for passwords?
No. Base64 is encoding, not encryption. Anyone can decode it instantly. For passwords, use bcrypt, SHA-256, Argon2, or similar hashing algorithms with a salt.
How do I convert an image to Base64?
Use our Image to Base64 converter: drag and drop your image, click Convert, and get the Base64 string instantly. Perfect for embedding in CSS, HTML, and API payloads.
Does Base64 encoding increase file size?
Yes, by approximately 33%. Three binary bytes are encoded as four ASCII characters. Use Base64 when you need binary data in text-based formats (JSON, XML, CSS), not for serving images at scale.
What is Base64URL safe encoding?
Base64URL is a variant of Base64 that replaces + with -, / with _, and removes = padding. Defined in RFC 4648 §5. Ideal for JWT tokens, URL parameters, filenames, and webhooks.
What is Base64 encoding?
Advanced options explained
Security & Privacy
Completely free
How Base64 works

Other Tools

Base64 Decode → Image to Base64 →