Base64 Encode / Decode — Free, No Sign-up
Free tool to encode text to Base64 or decode it back, switching modes in one click. Useful for email attachments and JWT tokens. Runs in your browser — nothing sent to a server.
What Is Base64 Encoding and Decoding?
Base64 is a way of representing binary data — or any string — using only 64 ASCII characters: A–Z, a–z, 0–9, +, and /. It was designed so that binary data could travel safely through old mail systems and other channels that only handled 7-bit ASCII text, without any bytes getting corrupted or misinterpreted along the way.
This tool converts between plain text and Base64 with a single click. Everything runs locally in your browser, so nothing you type is ever sent to a server. Unicode text — Japanese, emoji, accented characters, and more — is converted correctly because the tool encodes through UTF-8 first.
How to Use the Base64 Converter
- Choose a mode Pick "Encode" to turn text into Base64, or "Decode" to turn Base64 back into readable text.
- Paste your text Paste the string or Base64 data you want to convert into the Input field.
- Check the output The Output field updates in real time as you type, showing the converted result instantly.
- Copy the result Copy the output and paste it wherever you need it — an email attachment, a data URI, an API request, and so on.
Tips for getting more out of it
- The name Base64 comes from using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). The
=at the end is padding that makes the output length a multiple of 4 characters (two are added when the input length leaves a remainder of 1 byte when divided by 3, one when it leaves 2). - JWT (JSON Web Token) encodes its header, payload, and signature using Base64URL — a variant that replaces
+with-and/with_to be URL-safe. The output of this tool differs slightly from JWT tokens. When decoding, this tool also accepts-,_and missing padding, so you can paste each.-separated part of a JWT to read it. - Data URIs in HTML/CSS (
data:image/png;base64,iVBOR...) use Base64 to embed assets directly in source code without a separate file request. - Base64 is encoding, not encryption. Anyone can decode it instantly without a key. Never use it to protect sensitive information.
Ways to Use This Base64 Tool
Building data URIs
Convert text-based data such as SVG or CSS into Base64 and embed it in HTML or CSS as a data: URI like data:image/svg+xml;base64,.... To build one from an image file such as PNG or JPEG, use the File to Base64 Converter.
Inspecting a JWT payload
Decode the header and payload sections of a JWT to see the claims it carries (note that this does not verify the signature).
Debugging API responses
Many APIs return binary content Base64-encoded as text — decode it here while developing to check what is actually inside.
Preparing config values and env vars
Convert certificates or key files to Base64 so they can be embedded in an environment variable or configuration file.
Base64 Glossary
- Base64
- An encoding scheme that represents binary data using only 64 ASCII characters. Every 3 bytes of input becomes 4 output characters, so the result is about 33% larger than the original.
- Padding (=)
- One or more
=characters appended to the end of Base64 output so the total length works out to a multiple of 4. Whether none, one, or two are added depends on the length of the original data. - Base64URL
- A URL-safe variant of Base64 that replaces
+and/— both of which have special meaning inside a URL — with-and_. It is used in JWTs and OAuth tokens. - MIME
- The standard that lets email carry binary attachments like images and audio. Since SMTP can only handle 7-bit ASCII, MIME uses Base64 internally to turn binary data into safe plain text.
- Data URI
- A way to embed a file, such as an image, directly inside HTML or CSS without linking to an external resource, in the form
data:image/png;base64,....
FAQ
data:image/png;base64,...), JWT authentication tokens, and binary data transfer over text-based APIs.
Side Note — Base64, Email, and the URL Collision
The biggest driver behind Base64's adoption was email. SMTP in the 1970s–80s could only handle 7-bit ASCII text, so binary attachments would get corrupted in transit. MIME solved this by Base64-encoding binary data into plain text — a convention still used today inside every email attachment.
Base64's character set includes + and /, which have special meanings in URLs. To fix this, Base64URL was invented (+→-, /→_, no padding). JWT and OAuth tokens use Base64URL, which is why they look slightly different from standard Base64.
Converting 3 bytes of binary into 4 Base64 characters means the output is about 33% larger than the input. Embedding large images as data URIs bloats HTML files significantly — it's fine for small icons, but not recommended for larger assets.