Base64 Encoder

Base64 Encoder / Decoder

Encode text or files to Base64, or decode Base64 back. URL-safe variant, UTF-8 safe, client-side only.

No. All encoding and decoding happens in your browser using built-in JavaScript APIs (TextEncoder, btoa, atob). Nothing is uploaded, logged, or stored.

Standard Base64 uses + and / which have special meanings in URLs. URL-safe Base64 (RFC 4648 §5) replaces them with - and _ respectively, so the output is safe to use in URLs, file names, and tokens like JWT.

Input

0 chars

Decoded output

0 chars

Why Base64?

Fast, accurate, with every option you'd expect.

Encode & decode

Convert any text or file to Base64, or decode Base64 back to the original data. Instant preview as you type.

Privacy by design

All encoding and decoding happens in your browser. Your text and files are never uploaded to any server.

Files & data URLs

Drop any file to get its Base64 string, a data URL (data:mime;base64,…), or decode a Base64 string back to a binary file.

URL-safe variant

Toggle URL-safe Base64 (Base64URL, RFC 4648) — replaces + with - and / with _ for use in URLs, file names, JWT, etc.

UTF-8 safe

Full Unicode support for any language, emoji, CJK, RTL scripts. Uses TextEncoder/TextDecoder so nothing is mangled.

Line wrap & padding

Optional MIME-style line wrap at 64 or 76 characters, and optional padding strip — for signatures, cookies, compact tokens.

How Base64 encoding works in your browser

Native browser APIs, no upload, lossless round-trip for any text or file.

  1. 1

    Pick text or file mode

    Toggle between text mode (paste any string) and file mode (drop any file up to ~50 MB). Text is processed via TextEncoder for proper UTF-8 handling — emoji and non-ASCII characters round-trip correctly. Files are read as ArrayBuffer.

  2. 2

    Encoder runs locally

    JavaScript's built-in btoa encodes the bytes to Base64. For URL-safe variant we replace + with - and / with _, and optionally strip padding (the format JWT uses). For very large files we chunk encoding to avoid blocking the main thread.

  3. 3

    Decoder is the inverse

    Paste a Base64 string and we run atob to decode. If you encoded a binary file originally, we offer a download with the original MIME type; if you encoded text, we decode it back via TextDecoder. Both directions are lossless.

  4. 4

    Copy, download, or generate a Data URI

    One-click copy puts the Base64 on your clipboard. Or download as a .txt file. Or generate a data:image/png;base64,... URI for inline embedding in CSS / HTML — assembled in your browser.

Common Base64 workflows

What people actually use Base64 for, and how iKit fits in.

Embedding small images in CSS

Convert a 2 KB icon to a Data URI to inline it in a stylesheet — saves an HTTP request. iKit produces the full data:image/png;base64,... string ready to paste.

JWT debugging

Decode the middle segment of a JWT to inspect the claims. Pair this with iKit's JSON Decoder for a clean two-step debugging flow that never sends the token to a server.

Email attachments via API

When a transactional email API requires Base64-encoded attachments, drop the file into iKit, copy the result, paste into your request body. No CLI base64 dance, no platform differences (macOS vs Linux flags).

PEM keys and certificates

Decode a PEM block (after stripping the BEGIN/END lines) to inspect the raw DER bytes. Or encode a binary key into PEM for tools that only accept text format.

Why Base64 privacy is non-negotiable

Base64 is the default carrier for sensitive payloads — JWTs containing user IDs and permissions, embedded customer photos, internal API responses. A server-side Base64 tool sees every byte you paste. iKit's encoder runs purely in JavaScript, so nothing leaves your browser tab.

  • Zero fetch or XHR calls during encode or decode.
  • Files up to ~50 MB processed locally without upload.
  • Lossless round-trip — encode then decode returns the exact original bytes.

Related guides

Deep-dive tutorials and tool comparisons from the iKit blog.

Frequently Asked Questions

Is my input sent to a server?

No. All encoding and decoding happens in your browser using built-in JavaScript APIs (TextEncoder, btoa, atob). Nothing is uploaded, logged, or stored.

What is URL-safe Base64?

Standard Base64 uses + and / which have special meanings in URLs. URL-safe Base64 (RFC 4648 §5) replaces them with - and _ respectively, so the output is safe to use in URLs, file names, and tokens like JWT.

Does it handle Unicode / emoji correctly?

Yes. We use TextEncoder to convert your text to UTF-8 bytes before encoding, and TextDecoder to convert the decoded bytes back. Any Unicode character — CJK, emoji, RTL scripts — round-trips correctly.

Can I encode files like PDFs or images?

Yes. Switch to File mode and drop any file. The tool gives you the Base64 string, a data URL you can paste into HTML/CSS, or a.txt download. File size is limited by browser memory (typically works up to several hundred MB).

What's the difference between with and without padding?

Standard Base64 pads the output with '=' characters so its length is a multiple of 4. Some uses (JWT, URL tokens) strip padding to save space; the decoder can reconstruct it. Check 'No padding' to strip trailing =.