Base64 Encoder / Decoder
Base64 decode and encode online in one fast tool. This free base 64 converter and base64 translator turns text to Base64 and decodes Base64 back to text, image, PDF, or file, with full UTF-8 support and a URL-safe option. Instant base64 encode decode online, private by design, no signup and no upload.
Reliable Base64 for any use case
Full Unicode, URL-safe option, instant conversion.
UTF-8 support
Encodes emoji, accents, and any Unicode character correctly.
URL-safe Base64
Replace + with -, / with _, strip = padding for URLs.
Encode and decode
Switch with one click. Live output as you type.
Error handling
Clear error messages for invalid Base64 input.
100% private
Encoding happens in your browser.
No size limits
Comfortably handles megabytes of text.
Who uses Base64?
Anyone moving binary data through text channels.
For developers
Inspect JWT tokens, encode credentials for HTTP Basic Auth, build data URLs.
For email developers
Encode attachments for MIME, build CSS-inline images for HTML emails.
For data engineers
Encode binary blobs in JSON or YAML where binary is not supported.
For security testers
Decode obfuscated payloads to understand attack patterns.
For backend developers
Generate and validate API request signatures or tokens.
For frontend developers
Build embedded images as data URLs to reduce HTTP requests.
About Base64
The encoding everywhere on the web.
What Base64 does
Base64 converts binary data (anything from images to encrypted blobs) into a string of 64 printable ASCII characters. The encoding represents every 3 bytes of input as 4 ASCII characters from the set A-Z, a-z, 0-9, +, /. This makes binary data safe to transmit over text-only protocols like email, JSON, XML, and HTTP headers. A base 64 converter like this one handles both directions, so you can encode text to Base64 and decode Base64 back to its original form without installing anything.
What is base 64 and where you see it
The term base 64 simply refers to a numbering system that uses 64 distinct symbols, and in computing it names the encoding scheme defined in RFC 4648. You run into base 64 far more often than you might think: HTML data URLs, the payload of a JWT, the Authorization header in HTTP Basic Auth, email attachments wrapped in MIME, public keys in PEM files, and binary fields stored inside JSON or YAML. Whenever a system can only carry plain text but the data is binary, base 64 is usually the bridge. Knowing how to read and write it by hand, or with a quick base64 translator, saves time across almost every part of web development.
How to base64 decode online
To base64 decode online, switch the tool to Decode mode and paste your encoded string. The decoded result appears live as you type, with a one-click copy button. This base64 encode decode online workflow runs entirely in your browser, so there is no waiting on a server and nothing leaves your device. It is the fastest way to read an encoded value when you only have the Base64 text and need the plain text behind it.
How to encode text to Base64
To convert text to Base64, keep the tool in Encode mode and type or paste your input. The base 64 output updates instantly. Because the encoder uses TextEncoder under the hood, emoji, accented letters, and any other Unicode characters are handled correctly. This makes the tool a reliable base64 translator for both plain English and international text.
Base 64 to text decoding
Converting base 64 to text is the most common reason people reach for a decoder. You might have copied a token, a config value, or an encoded log line and need the human-readable string behind it. Paste the Base64 into Decode mode and the original text appears immediately, decoded as UTF-8 so accented characters and emoji come back intact. If the result still looks like random bytes, the original data was probably not text at all (it could be an image or a compressed file), in which case use the file download option instead.
The 33% overhead
Base64 output is approximately 33 percent larger than the input. A 1 KB binary file becomes about 1.33 KB after encoding. This is the price of using only 64 printable characters out of the 256 possible byte values. For most use cases (HTTP headers, small images, JSON payloads) the overhead is acceptable. For large files (videos, big PDFs) prefer multipart upload or direct binary transfer.
How Base64 encoding works step by step
Base64 works by regrouping bits rather than bytes. The encoder takes the input three bytes at a time, which is 24 bits, then splits those 24 bits into four groups of 6 bits each. Each 6-bit group is a number from 0 to 63, and that number selects one character from the 64-character alphabet. When the input length is not a multiple of three, the encoder pads the final group with zero bits and appends one or two = characters so the output length stays a multiple of four. Decoding reverses the process exactly, which is why a base 64 converter never loses or alters a single byte.
URL-safe variant
Standard Base64 uses + and / characters, which have special meaning in URLs (+ is space, / is path separator). URL-safe Base64 replaces them with - and _ respectively, and strips the trailing = padding characters. JWT tokens, OAuth flows, and any Base64 in URL paths use the URL-safe variant. Toggle the URL-safe option to match your protocol.
Decoding a Base64 image
If you need to base64 decode an image, paste the Base64 string and the tool can reconstruct the binary content for download. A common pattern is a data URL such as data:image/png;base64,XXXX, where the part after the comma is the actual Base64. Copy that segment into the decoder to recover the PNG, JPEG, or GIF. The same flow works for any binary asset, which makes the converter a practical Base64 to file tool.
Base64 to file and Base64 to PDF
Converting Base64 to a file is just decoding plus a download. Paste the encoded string, decode it, and save the binary output with the correct extension. For a Base64 to PDF conversion, decode the string and save the result as a .pdf document, then open it in any PDF reader to confirm it is intact. This avoids round-tripping the data through a command line or a scripting language when you only need a one-off conversion.
Base64 in Python and other languages
Most programming languages ship Base64 support in their standard library. In Python, the base64 module provides base64.b64encode() and base64.b64decode() for bytes, plus urlsafe_b64encode() for the URL-safe variant. JavaScript exposes btoa() and atob() in the browser, and Buffer in Node.js. This online base64 converter is handy when you want to verify what your code produces or quickly decode a value without writing a script.
Base64 decode in Python explained
A common question is how to base64 decode in Python correctly. The base64.b64decode() function expects bytes, not a string, so you typically call it as base64.b64decode(encoded.encode()). The result is also bytes, so if you encoded plain text you finish with .decode("utf-8") to get a normal string back. For URL-safe input use base64.urlsafe_b64decode() instead, and pass validate=True if you want Python to reject any stray non-alphabet characters. When your script and this tool disagree, the cause is almost always a UTF-8 step or a missing URL-safe call, and pasting the same string here is a quick way to confirm which side is wrong.
Base64 is not encryption
Critical misconception: Base64 is encoding, not encryption. Anyone can decode Base64 instantly with no key, no password, nothing. Searches for phrases like "decrypt base64 online" really mean decode, because there is no key to recover. Never use Base64 to "hide" passwords, API keys, or any sensitive data. Use actual encryption (AES-256, RSA) for confidentiality. Use Base64 only when you need a text-safe representation of binary, not when you need secrecy.
Common Base64 decode errors
Most failed decodes come from a few predictable issues. Invalid padding happens when the = characters at the end are missing or wrong, since valid Base64 length is always a multiple of 4. Non-Base64 characters, like spaces, line breaks, or quotation marks copied along with the string, also break decoding. If you are decoding a URL-safe string, enable the URL-safe toggle so - and _ are read correctly. The tool shows a clear error message whenever the input cannot be decoded.
Base64 decode vs base64 encode: which mode you need
If your input is readable text or a file and you want a Base64 string out, you need base64 encode. If your input is already a string of A-Z, a-z, 0-9 and +/= characters and you want the original data back, you need base64 decode. A quick visual check helps: encoded Base64 has no spaces, often ends in one or two = signs, and its length is a multiple of four. This tool keeps both directions one click apart, so you can switch instantly if you picked the wrong mode, and the live output makes a mistake obvious right away.
Why use an online base 64 converter
An online base 64 converter is the fastest path for one-off work: no command line, no script, no dependency to install. It is also a dependable cross-check when your own code produces output you did not expect, since you can paste the same value here and compare. Because every conversion in this base64 encode decode online tool happens locally in your browser, you get that convenience without sending data to a server, which matters when the string contains tokens or internal identifiers. For repeated or automated work a library is still the right choice, but for inspecting, debugging, and learning, a browser-based converter is hard to beat.
How to encode and decode Base64
Three steps.
Pick mode
Encode or decode.
Toggle URL-safe
Only if you need URL-safe Base64.
Paste text
Plain text or Base64 string.
Copy result
Live output, one-click copy.
Frequently asked questions
If you don't find your question here, ask us directly.
Base64 is a method to represent binary data using only 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is commonly used to embed images in CSS or HTML, transmit binary attachments in email (MIME), and encode credentials in HTTP Basic Auth. Base64 encoding makes binary data safe to include in text-based formats.
Base64 represents 3 bytes of binary as 4 ASCII characters, so the output is approximately 33 percent larger than the input. A 1 KB file becomes about 1.33 KB after Base64 encoding. This overhead is the price of making binary data text-safe. For transmission over text-only channels (email, JSON, URLs), the overhead is worth it.
No. Base64 is encoding, not encryption. Anyone can decode Base64 instantly with no key. It only changes the representation of data, not its content. Never use Base64 to "hide" sensitive data like passwords. Use actual encryption (AES, RSA) for confidentiality.
Embedding images directly in CSS (data:image/png;base64,...) to reduce HTTP requests. Storing binary blobs in JSON or XML where binary is not allowed. HTTP Basic Authentication headers. SMTP email attachments (legacy). Generating data URLs for downloads. Avoid for very large files because of the 33% overhead.
Standard Base64 uses + and / characters, which have special meaning in URLs. URL-safe Base64 replaces + with - and / with _, making the output safe for URLs and filenames without further encoding. Our tool offers both modes via the URL-safe toggle.
Yes. Drop a file using the upload button, and the tool will Base64-encode the binary content. For images, you can wrap the result as a data URL like data:image/png;base64,XXX for direct embedding in HTML or CSS. Decoded Base64 can be downloaded as a binary file.
Switch to Decode mode and paste Base64-encoded text. The tool will convert it back to the original form. Common decode errors come from invalid padding or non-Base64 characters in the input. The tool will show an error message if the input cannot be decoded.
Yes. The Base64 tool runs entirely in your browser. Your text, files, and decoded output never leave your device. All encoding and decoding uses the browser native btoa() and atob() functions (with TextEncoder for full Unicode support).
Switch the tool to Decode mode and paste your Base64 string. The decoded text appears instantly, and you can copy it with one click. This base64 encode decode online tool is free, requires no signup, and processes everything locally in your browser.
Keep the tool in Encode mode and type or paste your text. The base 64 output updates live as you type. Because the encoder uses TextEncoder, it correctly handles emoji, accented characters, and any other Unicode input.
Yes. Paste the Base64 string and the tool can reconstruct the binary image for download. If you have a full data URL such as data:image/png;base64,XXXX, copy only the part after the comma into the decoder. The same approach works for PNG, JPEG, and GIF files.
Decoding Base64 to a file is just a decode followed by a download. Paste the encoded string, decode it, and save the binary output with the correct extension. For a Base64 to PDF conversion, save the decoded result as a .pdf and open it in any PDF reader to confirm it is intact.
Base64 cannot be decrypted because it is not encrypted in the first place. It is an encoding, so what people call "decrypt base64 online" is simply decoding. Paste the string into Decode mode and the original data is recovered instantly with no key needed.
Python includes a built-in base64 module. Use base64.b64encode() to encode bytes and base64.b64decode() to decode, plus base64.urlsafe_b64encode() for the URL-safe variant. This online converter is useful for verifying what your Python code produces or for quick one-off conversions without writing a script.
The most common causes are invalid padding (missing or extra = characters) and non-Base64 characters such as spaces or line breaks copied with the string. Valid Base64 length is always a multiple of 4. If the string is URL-safe, enable the URL-safe toggle so - and _ are read correctly.
Base 64 is an encoding scheme that represents binary data using 64 printable characters, defined in RFC 4648. The name comes from the size of its alphabet: A-Z, a-z, 0-9, plus two symbols. You see base 64 in data URLs, JWT tokens, HTTP Basic Auth headers, and email attachments wherever binary data needs to travel through a text-only channel.
Base64 encode takes readable text or a file and turns it into a Base64 string. Base64 decode takes that Base64 string and recovers the original data. Encoded output has no spaces, uses only A-Z, a-z, 0-9 and +/= characters, and its length is a multiple of four, which helps you tell which mode you need.
Switch the tool to Decode mode and paste your Base64 string. The original text appears instantly, decoded as UTF-8 so accented letters and emoji come back correctly. If the decoded result still looks like random bytes, the source data was probably not text, so use the file download option instead.
Use base64.b64decode() from the built-in base64 module, passing bytes such as encoded.encode(). The result is bytes, so call .decode("utf-8") if the original data was text. For URL-safe strings use base64.urlsafe_b64decode() instead. If your Python output and this tool disagree, the cause is usually a missing UTF-8 step or the wrong function.
Yes. This base 64 converter is completely free, requires no signup, and has no usage limits. It runs entirely in your browser, so encoding and decoding stay private and nothing is uploaded to a server. You can use it as often as you like for both encode and decode work.
Yes. The encoder uses the browser TextEncoder, so it handles emoji, accented characters, and any other Unicode input correctly in both directions. Many older base64 tools only handle ASCII and corrupt non-English text. As a base64 translator, this tool round-trips international text without data loss.
Related tools
Try our other free tools
Word counter, character counter, case converter, and 47 more.