Base64 Encoder
Encode text to Base64 or decode a Base64 string in the browser.
What is a Base64 encoder?
A Base64 encoder is a tool that converts text or binary data into a 64-character ASCII string (A–Z, a–z, 0–9, +, /) — or decodes that string back. Base64 is encoding, not encryption; it is used for HTTP headers, JSON, email attachments, and HTML/CSS data URIs.
Base64 does not compress or encrypt data. The encoded output is roughly 33% larger than the original. Its only purpose is to make binary data safe to transmit as text without corruption.
How to Use the Base64 Encoder & Decoder
Paste your text or Base64 string
Paste the plain text you want to encode, or the Base64 string you want to decode, into the input field.
Choose Encode or Decode
Select Encode to convert plain text to a Base64 string, or Decode to convert a Base64 string back to plain text.
Copy the output
Click the copy button to copy the result to your clipboard.
Use in your code or request
Paste the result into your HTML data URI, HTTP Authorization header, API payload, or wherever it is needed.
Who Is This For?
- ▸ Developers embedding images in HTML or CSS as data URIs — encode the image file to Base64 and insert it directly into your code to eliminate an HTTP request.
- ▸ Backend engineers encoding credentials for HTTP Basic Auth headers — the Authorization header requires
username:passwordBase64-encoded before sending. - ▸ Anyone decoding a Base64 string received from an API — decode the value to inspect the raw content without writing a script.
Key Benefits
- ✓ Runs entirely in your browser. Tool inputs stay in the browser.
- ✓ Free with no subscription — no account, no paywall, no usage limits.
- ✓ No account required — open the page and start encoding immediately.
- ✓ Supports standard and URL-safe Base64 — encode in the correct variant for URLs, JWTs, or standard data transmission.
Common Base64 Encoding Mistakes
- Encoding non-ASCII text without UTF-8 conversion first: Characters outside ASCII (emoji, accented letters) must be UTF-8 encoded before Base64 — skipping this step produces garbled output on the receiving end.
- Using Base64 for security: Base64 is encoding, not encryption. Anyone with the string can decode it instantly — never use it to "protect" passwords or sensitive data at rest.
- Incorrect padding: Base64 output must be a multiple of 4 characters. Missing or extra
=padding characters cause decoding failures — most decoders are strict about this. - Using standard Base64 in URLs: The
+and/characters in standard Base64 have special meaning in URLs. Use URL-safe Base64 (replacing+with-and/with_) for any URL or JWT context.
When working with encoded data in URLs, the URL encoder handles percent-encoding separately from Base64. If you are inspecting JWT tokens, the JWT decoder automatically handles the Base64Url decoding for you.
Further reading: RFC 4648 — Base Encodings (IETF)
Common Uses for Base64
- Basic Authentication: HTTP Basic Auth requires headers formatted as
username:passwordand encoded in Base64. - Data URIs: Embedding small images or fonts directly into CSS or HTML files to reduce HTTP requests.
- Email Attachments: Email protocols (SMTP) were originally designed for text; attachments are often Base64 encoded to ensure safe delivery.
- JSON Web Tokens (JWT): JWTs consist of three parts (Header, Payload, Signature) that are Base64Url encoded.
Is Base64 Encryption?
No. Base64 is not encryption. It is simply a translation of data into a different format. Anyone with access to the Base64 string can instantly decode it back to the original text. Never use Base64 to secure or "encrypt" passwords or sensitive data at rest. For actual security, use cryptographic hashing (like bcrypt) or encryption algorithms (like AES).
URL-Safe Base64
Standard Base64 contains characters (+ and /) that have special meaning in URLs. When passing Base64 data in a URL query parameter or routing path, developers use a "URL-Safe" variant where + is replaced by - (dash) and / is replaced by _ (underscore). JWT tokens use this URL-safe variant.
Frequently Asked Questions
What is Base64 encoding?
Base64 is a method of encoding binary data as ASCII text using 64 printable characters — A-Z, a-z, 0-9, +, and /. It is commonly used to embed images in HTML or CSS, encode email attachments, and pass binary data through text-only systems like JSON or XML. Base64 does not compress data — the encoded output is roughly 33% larger than the original.
Is this tool free?
Yes. This Base64 Encoder is free to use now — ads are not live yet — with no account required. Encode and decode run entirely in your browser. Tool inputs stay in your browser. The site uses aggregate Google Analytics.
Why does Base64 end in == ?
Base64 encodes 3 bytes of input at a time into 4 characters of output. If the input length is not a multiple of 3, padding characters (= or ==) are added to complete the final 4-character group. One = means one byte of padding was needed; == means two bytes of padding were needed. This padding is required for correct decoding.
Is Base64 the same as encryption?
No. Base64 is encoding, not encryption. It is trivially reversible by anyone — there is no key or password involved. It only converts binary data into a text-safe format for transmission. Never use Base64 to secure passwords or sensitive data at rest. For actual security, use cryptographic hashing (like bcrypt) or encryption algorithms (like AES).
What is URL-safe Base64?
Standard Base64 uses + and / characters that have special meaning in URLs. URL-safe Base64 replaces + with - (hyphen) and / with _ (underscore), making the encoded string safe to include in a URL path or query parameter without additional percent-encoding. JWT tokens, for example, use URL-safe Base64.
Can Base64 encode binary files like images?
Yes. Base64 is most commonly used to encode binary files. When you embed an image in HTML or CSS as a data URI, the image file is Base64-encoded and inserted directly into the code — for example: src="data:image/png;base64,[encoded string]". This eliminates an HTTP request but increases the size of the HTML or CSS file.
This tool is provided for informational and educational purposes only. Results are not a substitute for professional advice.
Free Tools Alert
Get new tools, templates, and calculators in your inbox. No fake subscriber counts.
No spam. One-click unsubscribe.