Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 back to text instantly β with URL-safe support for JWTs and URLs.
About the Base64 Encoder & Decoder
Convert text to Base64 and back instantly. Useful for API authentication headers, JWT token inspection, embedding data in URLs, and more. Everything runs locally in your browser β no data is sent to a server.
What is Base64 used for?
Base64 encodes binary or text data as ASCII characters so it can be safely transmitted in systems that only handle text β such as email, URLs, JSON payloads, and HTTP headers.
Is Base64 the same as encryption?
No. Base64 is a reversible encoding scheme, not encryption. Anyone can decode a Base64 string back to its original form. Never use it to protect sensitive data.
What is URL-safe Base64?
Standard Base64 uses the characters + and /, which have special meaning in URLs. URL-safe Base64 replaces these with - and _ so the result can be used directly in URLs, filenames, and JWT tokens.
About the Base64 Encoder / Decoder
Our free Base64 encoder and decoder converts text or data to and from Base64 encoding instantly in your browser. Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (AβZ, aβz, 0β9, +, /). It is widely used in software development, web APIs, email systems, and data transfer protocols where binary data needs to be safely transported through systems that handle only text.
Base64 encoding increases the data size by approximately 33% (every 3 bytes become 4 characters), which is the trade-off for the universal compatibility it provides across text-based systems.
How Base64 Works
Base64 takes binary data and encodes it as ASCII text using a fixed alphabet of 64 characters. Every 3 bytes of input data are converted to 4 Base64 characters. If the input is not divisible by 3, padding characters (= or ==) are added to ensure the output length is a multiple of 4. Decoding reverses this process exactly.
Common Uses for Base64
- API data transfer β Encode binary payloads (images, files, audio) into Base64 strings to include them in JSON API requests and responses.
- Email attachments β The MIME standard uses Base64 to encode email attachments so they can travel through text-based email protocols (SMTP).
- Inline images in HTML/CSS β Embed small images directly in HTML or CSS as Base64 Data URIs, eliminating an extra HTTP request.
- Authentication tokens β HTTP Basic Authentication encodes username:password credentials in Base64 (though this is not encryption β Base64 is easily reversed).
- JWT tokens β JSON Web Tokens use Base64URL encoding (a URL-safe variant) for their header and payload sections.
- Cryptography β Base64 is used to represent binary keys, certificates, and encrypted data in human-readable formats (PEM files, SSH keys).
- Data URIs β Include fonts, icons, and small images directly in CSS stylesheets as Base64-encoded Data URIs.
How to Use the Base64 Tool
- Encode text to Base64 β Paste or type your text, then click "Encode". The Base64 output appears instantly.
- Decode Base64 to text β Paste a Base64 string and click "Decode" to recover the original text.
- Encode a file β Use the file upload option to encode binary files (images, PDFs) to Base64.
- Copy result β Click "Copy" to copy the encoded or decoded output to your clipboard.
Frequently Asked Questions
Is Base64 encoding the same as encryption?
No. Base64 is encoding, not encryption. It is trivially reversible by anyone who knows it is Base64. Do not use Base64 to protect sensitive data β use proper encryption for that purpose.
What is the difference between Base64 and Base64URL?
Base64 uses + and / characters which have special meanings in URLs. Base64URL replaces + with - and / with _ to make encoded strings URL-safe without percent-encoding. JWTs use Base64URL encoding.
Why does Base64 output end with = signs?
The = characters are padding. Base64 works in groups of 4 characters. If the input length is not divisible by 3, one or two = characters are added as padding to complete the final group.
Is my data sent to a server when I encode/decode?
No. All encoding and decoding happens in your browser using JavaScript. Your data is never transmitted to our servers.