Base64 Encoder & Decoder
Encode text or files to Base64 and decode Base64 back to text. Supports Base64URL for JWTs and URLs, no-padding output, 76-character MIME chunk splitting, per-line encoding, and image-to-data-URI conversion. Nothing leaves your browser.
When You Actually Need Base64
You need Base64 when binary or special-character data must travel through a system built for plain text. Three common situations: embedding images directly in HTML or CSS without a separate file request, HTTP Basic Auth headers (Authorization: Basic dXNlcjpwYXNz where the value is Base64 of user:pass), and passing binary data through JSON APIs that only accept strings.
Encoding Options Explained
- Base64URL — replaces
+with-and/with_, making the output safe in URLs and filenames. Required for JWT tokens. Ticking this automatically handles the substitution. - No padding — removes the trailing
=signs. The receiver can infer the correct length without them. Used in JWT (which always drops padding) and some URL contexts where=needs escaping. - Split into 76-char MIME chunks — inserts a line break every 76 characters. This is the MIME (RFC 2045) standard for email attachments and some XML/HTML embedding contexts where very long lines cause problems.
- Encode each line separately — encodes each line of input as an independent Base64 string. Useful for batch-encoding a list of values in one pass.
Base64URL vs No Padding — What is the Difference?
These are separate options that can be combined. Base64URL changes which characters are used (-_ instead of +/). No padding removes the = signs at the end. JWT uses both together — Base64URL encoding without padding. You can tick both checkboxes to match exactly what JWTs expect.
Image to Data URI
The Image tab converts any PNG, JPG, GIF, SVG or WebP image into a Base64 data URI ready to paste directly into HTML or CSS. The format is data:image/png;base64,... which browsers load inline without a separate HTTP request — useful for small icons and logos.