Developer Tool

Base64 Encoder / Decoder

Encode text or files to Base64, decode Base64 strings back to plaintext, and preview Base64 images โ€” all instantly in your browser. No uploads, no account, no limits.

Samples:
0 chars

Free Online Base64 Encoder and Decoder โ€” No Upload Required

Base64 is a binary-to-text encoding scheme that converts arbitrary data into a safe string of 64 printable ASCII characters. It is used everywhere in web development: embedding images directly in HTML or CSS, passing credentials in HTTP Authorization headers, encoding binary payloads inside JSON and XML APIs, and storing small binary blobs in text databases or environment variables.

QuickToolkit's Base64 encoder and decoder runs entirely in your browser โ€” no file ever leaves your device. It handles both plain text encoding/decoding and full file encoding (images, PDFs, audio, any binary) into a ready-to-use data URI. Paste a Base64 string to decode it back to text or preview the embedded image instantly. One click copies the result to your clipboard.

Unlike online tools that upload your data to a server, everything here runs with the browser's built-in btoa() and atob() APIs, augmented with proper Unicode handling so characters outside ASCII (emoji, accented letters, CJK) encode and decode correctly every time. No account, no rate limit, no watermark.

How to Use the Base64 Tool

  1. 1

    Choose Text Mode or File Mode

    Text Mode is for encoding a string (like a password, JSON snippet, or API key) or decoding a Base64 string back to readable text. File Mode accepts any binary file and produces a Base64 data URI you can embed directly in HTML or CSS.

  2. 2

    Enter your input or drop a file

    In Text Mode, type or paste your content in the input box. Use one of the sample buttons to test immediately. In File Mode, drag a file onto the drop zone or click to browse.

  3. 3

    Click Encode or Decode

    Hit "Encode to Base64" to convert plaintext to its Base64 equivalent, or "Decode to Text" to reverse the process. For files, encoding happens automatically as soon as you select one.

  4. 4

    Copy the output and use it

    Click Copy to send the result to your clipboard. Use Swap to instantly flip input and output โ€” handy when you want to round-trip or verify encoding. For image data URIs, a live preview is shown below the output.

Key Features

๐Ÿ”’

Encode Text to Base64

Convert any text string โ€” including Unicode, emoji, and multi-byte characters โ€” to a valid Base64 string instantly.

๐Ÿ”“

Decode Base64 to Text

Paste any Base64-encoded string and decode it back to readable text in one click. Auto-strips data URI prefixes.

๐Ÿ“‚

File to Base64 Data URI

Drop any file โ€” image, PDF, font, audio โ€” and get a complete data URI ready to embed in HTML or CSS.

๐Ÿ–ผ๏ธ

Inline Image Preview

When encoding an image or decoding a Base64 image string, a live thumbnail preview is rendered immediately.

๐Ÿ“‹

One-Click Copy

Copy the full output to your clipboard instantly. A confirmation badge confirms the copy was successful.

โ†•๏ธ

Swap Input/Output

Flip input and output with one click to chain operations or verify a round-trip without manual copying.

๐Ÿ“

Size & Ratio Display

See the original byte size, encoded size, and the percentage overhead at a glance โ€” helpful when optimising data URIs.

๐Ÿ”’

100% Client-Side

Nothing is ever sent to a server. All encoding and decoding runs locally using browser-native APIs.

Common Use Cases

HTTP Basic Authentication

The Authorization: Basic header requires Base64-encoded "username:password". Encode credentials here to build or debug auth headers quickly.

Embedding Images in HTML/CSS

Use the File Mode to encode a small icon or logo. Paste the data URI into an <img src> or background-image: url() to eliminate an extra HTTP request.

API Payload Encoding

Many REST and GraphQL APIs transmit binary data (PDFs, thumbnails) as Base64 fields inside JSON. Encode or inspect those payloads here.

Email MIME Attachments

SMTP encodes attachments in Base64 inside MIME messages. Decode a raw email source to extract or inspect the attachment data.

Environment Variable Storage

Store binary credentials (service account JSON, TLS certificates) as Base64 in .env files or CI secrets to avoid multi-line formatting issues.

Debugging JWT Tokens

JWT headers and payloads are Base64url-encoded. Decode the payload segment here to inspect claims without a separate JWT tool.

How Base64 Encoding Works

Base64 takes every 3 bytes (24 bits) of input and splits them into four 6-bit groups. Each 6-bit group maps to one of 64 characters: Aโ€“Z, aโ€“z, 0โ€“9, +, and /. When the input length is not a multiple of 3, padding characters (=) are appended so the output length is always a multiple of 4.

PropertyDetail
Alphabet size64 safe ASCII characters (Aโ€“Z, aโ€“z, 0โ€“9, +, /)
Encoding ratio3 bytes in โ†’ 4 chars out (33% size increase)
Padding character= (1 or 2 appended when input is not divisible by 3)
Unicode supportMust encode UTF-8 bytes first, then Base64 (this tool does that automatically)
Base64url variantReplaces + with - and / with _ for URL-safe use (JWT, URL parameters)
Standard referenceRFC 4648

Frequently Asked Questions

๐Ÿš€Share this tool with friends!

Help others discover this free tool. Share on your favorite platform!

๐Ÿ’ก Did you know? QuickToolkit is 100% free, with no ads or signup required!