Base64 Encoder / Decoder
Encode and decode Base64 for text and files. URL-safe mode, auto-detect, and file data URI generation. 100% in-browser.
Encode and decode Base64 for text and files. URL-safe mode, auto-detect, and file data URI generation. 100% in-browser.
No. All Base64 encoding and decoding is performed locally in your browser using the atob() and btoa() browser APIs. Text input, file content, and output remain entirely on your device.
Standard Base64 uses the characters + and / which have special meaning in URLs, causing encoding errors in query strings or path segments. URL-safe Base64 replaces + with - and / with _, making the output safe for direct use in URLs, JWT tokens, and file names without percent-encoding.
Yes. Switch to the File tab, drag and drop any image or binary file, and the tool converts it to a Base64-encoded data URI (e.g. data:image/png;base64,...). These URIs can be embedded directly in HTML, CSS, or JSON payloads without a separate file upload.
Base64 encodes binary data as ASCII text by grouping every 3 bytes into 4 printable characters drawn from a 64-character alphabet (A–Z, a–z, 0–9, +, /). The output is about 33% larger than the input. A = padding character aligns the output length to a multiple of 4.
Standard Base64 uses + and / which have special meanings in URLs (query separators). URL-safe Base64 (RFC 4648 §5) replaces + with - and / with _. Use URL-safe mode for JWT tokens, URL parameters, and filenames. Both variants are supported here with automatic conversion.
A Data URI embeds file content directly into HTML or CSS: data:<mediatype>;base64,<data>. Useful for small images in CSS backgrounds or email HTML where external references are blocked. Avoid for large files (>10 KB) as they increase page weight and can't be cached separately by the browser.
The auto-detect mode checks whether the input looks like valid Base64 (character set, length divisible by 4 with optional padding) and automatically chooses encode or decode. If you see unexpected output, switch to explicit Encode or Decode mode.