Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 to text instantly. Supports UTF-8.
0 characters
0 characters
How It Works
Related Tools
Related Articles
Frequently Asked Questions
What is Base64 encoding?
Is Base64 encoding secure?
Why does Base64 make data larger?
What is the difference between Base64 and Base64URL?
Can I encode binary files like images with this tool?
Does Base64 encoding handle Unicode and special characters?
What are data URIs and how does Base64 relate to them?
Is there a maximum input size?
How to Encode and Decode Base64
Converting text to Base64 or decoding Base64 strings back to readable text is fast and simple with our free online tool. Whether you are working with API payloads, embedding data in HTML, or debugging encoded strings, here is how to use the encoder and decoder.
Step 1: Choose your operation. Select whether you want to encode (convert plain text to Base64) or decode (convert Base64 back to plain text). The interface clearly separates these two operations so there is no confusion about which direction the conversion goes.
Step 2: Enter your input. For encoding, paste or type the plain text you want to convert to Base64. This can be any text including JSON, XML, HTML, configuration strings, or raw data. For decoding, paste the Base64 string you want to convert back to readable text. The tool accepts standard Base64 with or without padding characters.
Step 3: View the result. The converted output appears instantly. For encoding, you get a Base64 string that is safe for transmission through text-based protocols. For decoding, you get the original plain text that was encoded. If the input is not valid Base64, the tool displays a clear error message.
Step 4: Copy the output. Click the copy button to place the result on your clipboard. Paste it into your code, API client, email, configuration file, or wherever you need the encoded or decoded value.
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a string of printable ASCII characters. It was designed to solve a fundamental problem in computing: how to safely transmit binary data through systems that only support text. Email protocols, URL parameters, JSON payloads, and HTML attributes all have restrictions on which characters they can contain. Base64 guarantees that the output uses only safe, universally supported characters.
The encoding process works by taking every 3 bytes (24 bits) of input and splitting them into four 6-bit groups. Each 6-bit group maps to one of 64 characters: the uppercase letters A through Z (26 characters), lowercase letters a through z (26 characters), digits 0 through 9 (10 characters), plus sign (+), and forward slash (/). When the input length is not a multiple of 3, one or two padding characters (=) are appended to the output.
This encoding scheme was first standardized in RFC 1421 for Privacy Enhanced Mail (PEM) in 1993, and the current standard is defined in RFC 4648. The name "Base64" comes from the 64-character alphabet used for encoding. A related variant called Base64URL replaces the + and / characters with - and _ to make the output safe for use in URLs and filenames.
The trade-off of Base64 encoding is a 33% increase in data size: every 3 bytes of input produce 4 bytes of output. This overhead is generally acceptable for small to medium payloads but becomes significant for large files, which is why Base64 encoding is typically used for small data like icons, configuration values, and authentication tokens rather than large media files.
Base64 Encoder & Decoder Use Cases
Data URIs in HTML and CSS. Base64 encoding allows you to embed images, fonts, and other assets directly in HTML or CSS files as data URIs. For example, data:image/png;base64,iVBOR... embeds a PNG image inline, eliminating the need for a separate HTTP request. This technique is valuable for small icons, sprites, and critical above-the-fold images where reducing HTTP requests improves page load performance.
Email attachments (MIME encoding). The MIME standard for email uses Base64 to encode binary attachments like documents, images, and archives so they can be transmitted through the text-based SMTP protocol. When you attach a file to an email, your email client Base64-encodes it before sending and the recipient's client decodes it upon delivery.
API authentication and payloads. HTTP Basic Authentication encodes the username and password as a Base64 string in the Authorization header. Many APIs also use Base64 to encode binary data within JSON payloads, since JSON only supports text values. JWT (JSON Web Tokens) use Base64URL encoding for their header and payload sections.
Storing binary data in text formats. Databases, configuration files, and serialization formats that only support text can store binary data by Base64-encoding it. XML documents, JSON files, and environment variables frequently contain Base64-encoded values for certificates, encryption keys, and binary configuration data.
Debugging and development. Developers frequently need to decode Base64 strings to inspect their contents during debugging. Whether it is examining JWT token payloads, reading encoded API responses, decoding error messages, or inspecting MIME-encoded email content, a quick Base64 decoder is an essential part of the developer toolkit.
Why Use Our Base64 Encoder & Decoder?
Instant conversion with no server round-trip. Encoding and decoding happen entirely in your browser using JavaScript. The result appears the moment you enter your input, with no network request, no loading spinner, and no server processing. This is not only faster but also means the tool works offline after the initial page load.
Full UTF-8 support. Our tool correctly handles multi-byte Unicode characters, including accented letters, emoji, CJK characters, and other non-ASCII text. Many Base64 tools only handle ASCII input, producing incorrect results for international text. We use proper UTF-8 encoding before Base64 conversion to ensure accuracy with any language or character set.
Complete privacy. Your data never leaves your browser. Whether you are encoding API credentials, decoding JWT tokens, or working with any other sensitive data, nothing is transmitted to a server, logged, or stored. You can verify this by encoding data with your network tab open in browser developer tools.
Handles large inputs. Since processing happens locally, there are no server-imposed size limits. Encode or decode large payloads, entire configuration files, or lengthy data strings without hitting arbitrary restrictions. The practical limit is your device's available memory, which on modern devices accommodates inputs of several megabytes.
Free and unrestricted. There is no signup, no account, no daily limit, and no premium tier. Use the tool as often as you need, encode as much data as you want, and never see a paywall or usage restriction. It is designed to be a reliable utility that is always available when you need it.