All tools

Base64 Encoder

Encode and decode Standard, Base64URL, MIME, and No-Padding. Auto-detect JWT, images, and JSON. Files stay in your browser — nothing is uploaded.

100% in-browserNo signupFree forever
Runs fully in browserNo data leaves your devicePrivacy-first
0 opsInput 0 B
Input — Plain text

0 chars · 0 B

⌘Enter
Output — Base64
0 B output

⌘Enter process · ⌘⇧C copy · ⌘⇧X swap · ⌘K clear

JWT DecoderPassword Generator

What Is a Base64 Encoder Decoder?

A Base64 encoder decoder converts binary or text data into a portable ASCII string — and back again. Base64 is used everywhere: HTTP Basic Auth headers, JWT tokens, data URIs in HTML/CSS, email attachments (MIME), and API payloads. This tool handles all four variants in one place: Standard (RFC 4648), Base64URL (safe in URLs and tokens), MIME (line-wrapped for email), and No-Padding.

How it works

Encode or Decode in 4 Steps

01

Paste or upload

Type text, paste a Base64 string, or drag a file. The tool auto-detects JWT, image, and JSON content.

02

Pick a mode

Choose Encode or Decode. Select a variant: Standard, Base64URL, MIME, or No-Padding.

03

See instant output

Output updates automatically. Images are previewed live. JWTs link to the JWT Decoder.

04

Copy or export

Click Copy or download the result. Use the security scanner to check for secrets before sharing.

Use cases

When Developers Use Base64

🔐

HTTP Basic Auth

Encode username:password as Base64 for the Authorization: Basic header.

🪙

JWT Decoding

JWT header and payload are Base64URL-encoded. Decode them to inspect claims.

🖼️

Image Data URIs

Convert PNG/JPG/SVG to Base64 for inline use in HTML <img> or CSS background-image.

📧

Email Attachments

MIME Base64 (line-wrapped at 76 chars) is the standard for email attachment encoding.

🔗

URL-safe Tokens

Base64URL avoids + / = so tokens survive in URLs and query strings unchanged.

🔍

Secret Detection

Run the built-in security scanner to flag passwords, API keys, and PII in any string.

Base64 vs Base64URL — Key Differences

Standard Base64 uses + and / with = padding — these characters are percent-encoded in URLs, breaking tokens. Base64URL replaces + with - and / with _ and omits padding, so the result is safe in URLs, JWTs, and OAuth tokens with no escaping needed. Choose Base64URL for any token or query-string value; use Standard for general encoding.

How to Encode an Image to Base64 for HTML or CSS

Switch to File mode, drag and drop your image (PNG, JPG, GIF, WebP, SVG), and the tool reads it entirely in your browser. The output is the raw Base64 string. Use it as data:image/png;base64,<result> in an img src or CSS background-image: url(...). Switch to Image mode to paste any Base64 string and see a live preview.

FAQ

Frequently Asked Questions

1What is Base64 encoding?
Base64 converts binary or text data into ASCII characters (A–Z, a–z, 0–9, +, /) for safe transport in JSON, URLs, or email. Every 3 bytes become 4 characters; = padding fills the remainder.
2What is the difference between Base64 and Base64URL?
Standard Base64 uses + and / with optional = padding. Base64URL replaces + with - and / with _ and omits padding, making it safe in URLs, query strings, and JWT tokens without percent-encoding.
3Is Base64 the same as encryption?
No. Base64 is encoding, not encryption. It converts binary to ASCII for safe transport but provides zero security — anyone can decode it instantly. Never use Base64 alone to protect sensitive data.
4How do I encode HTTP Basic Auth credentials in Base64?
Format credentials as username:password (e.g. alice:s3cr3t), paste into the tool, choose Encode → Standard. Copy the result and prefix it with "Basic " in your Authorization header.
5How do I decode a JWT token using Base64?
JWTs have three dot-separated parts; the header and payload are Base64URL-encoded. Paste the full JWT or one part, select Decode → Base64URL. For full JWT validation use our JWT Decoder.
6Is it safe to paste sensitive data here?
Yes. This tool runs entirely in your browser. Nothing is uploaded to any server. Your data never leaves your device. Use the security scanner to detect secrets before sharing output.
7Can I encode large files to Base64 in the browser?
Yes — up to 50 MB. Files over 5 MB are processed in a background task so the page stays responsive.
8Why does Base64 output end with = or ==?
= padding makes the string length a multiple of 4 so decoders work correctly. One = means 2 padding bytes needed; == means 1. Base64URL and No-Padding variants omit them.
9How do I encode an image to Base64 for HTML or CSS?
Switch to File mode and drag in your image (PNG, JPG, GIF, WebP, SVG). Copy the output and use it as data:image/png;base64,<result> in an img src or CSS background-image: url(...).
10What is MIME Base64 used for?
MIME Base64 wraps output at 76 characters per line as required for email attachments (RFC 2045). Choose the MIME variant when encoding files for email clients.
11How do I encode Base64 in JavaScript?
Use btoa() for ASCII strings: btoa("hello") → "aGVsbG8=". For binary data use FileReader or TextEncoder. For Base64URL replace +/ with -_ and strip = padding.
12What is the difference between Base64 and hex encoding?
Hex uses 2 characters per byte (~100% overhead). Base64 uses 4 characters per 3 bytes (~33% overhead), making it more compact. Base64 is preferred for text transport; hex is common in cryptography output.
Learn more

Developer Guides

Feedback for base64_encoder

Tell us what's working, what's broken, or what you wish we built next — it directly shapes our roadmap.

You make the difference

Good feedback is gold — a rough edge you hit today could be smoother for everyone tomorrow.

  • Feature ideas often jump the queue when lots of you ask.
  • Bug reports with steps get fixed faster — paste URLs or examples if you can.
  • Name and email are optional; we won't use them for anything except replying if needed.

Stay Updated

Get the latest tool updates, new features, and developer tips delivered to your inbox.

What you'll get
  • Product updates & new tools
  • JSON, API & developer tips
  • Unsubscribe anytime — no hassle

Get in touch

Feature ideas, bugs, or a quick thanks — we read every message.