A
AllKit

Base64 Encode / Decode

Encode and decode Base64 strings instantly in your browser.

100% Client-Side — Your data never leaves your browserFree — No signup required
Text → Base64

Need API access to Base64 Encode / Decode?

Integrate this tool into your workflow with our REST API. 3 free requests/day, unlimited with Pro.

View API Plans

What is Base64 Encode / Decode?

Base64 is one of those things you run into constantly as a developer but rarely think about until you need to encode or decode something in a hurry. You get a Base64 string in an API response and need to see what's inside. You need to embed a small image directly in CSS. You're debugging a JWT token and want to read the payload. You're working with email headers that encode subject lines in Base64. This tool handles all of that instantly.

AllKit's Base64 encoder and decoder works in both directions: paste plain text to get Base64, or paste Base64 to get the original text back. It fully supports UTF-8, so you can encode text in any language — Chinese, Arabic, emoji, special characters — and it all round-trips correctly. It also supports URL-safe Base64 (using - and _ instead of + and /) which is commonly used in JWT tokens, URL parameters, and file names.

The tool handles large inputs efficiently because everything runs in your browser using native JavaScript APIs. There's no server involved, no file size restrictions from an upload endpoint, and no waiting for network roundtrips. Paste a massive Base64 string from a data URI and see the decoded result instantly.

Security matters when you're encoding and decoding data. Because this tool runs entirely client-side, your data never touches a server. This makes it safe for decoding Base64 strings that contain sensitive information like API keys, tokens, encoded credentials, or personal data. You're not sending your secrets to some random server to decode them.

Why use AllKit?

  • No ads, no distractions — a clean interface that lets you focus on the task
  • Privacy-first100% client-side processing, nothing is uploaded
  • Free forever — core tools are free with no usage limits
  • API available — integrate into your workflow via our REST API

How to Use Base64 Encode / Decode

  1. Choose your mode: Encode (text to Base64) or Decode (Base64 to text). The default is Encode.
  2. Paste or type your input in the top text area. For encoding, enter the plain text you want to convert. For decoding, paste the Base64 string.
  3. The result appears instantly in the output area below. There's no need to click a button — the conversion happens in real time as you type.
  4. Use the URL-safe toggle if you need Base64 that's safe for URLs and filenames. This replaces + with - and / with _ in the output, which is required for JWT tokens and URL parameters.
  5. Click the Copy button to copy the result to your clipboard. A brief confirmation appears to let you know it worked.
  6. To swap directions (decode what you just encoded, or vice versa), click the swap button to flip the input and output.
  7. For file encoding, you can paste the content of binary files as text. For image embedding, the output gives you a data URI you can use directly in HTML or CSS.

Common Use Cases

Decoding JWT Tokens

JWT tokens consist of Base64-encoded JSON segments. While AllKit has a dedicated JWT Decoder, you can also paste individual token segments here to see the raw JSON header or payload.

Embedding Images in HTML/CSS

Convert small images (icons, logos) to Base64 data URIs to embed them directly in HTML or CSS. This eliminates extra HTTP requests, which can improve page load performance for small assets.

Debugging API Responses

Many APIs return data encoded in Base64 — especially binary data like PDF files, images, or encrypted payloads. Paste the Base64 string here to see what's inside without writing any code.

Email Header Decoding

Email subjects and headers with non-ASCII characters are often encoded in Base64 (indicated by =?UTF-8?B?...?= format). Decode them here to read the actual text content.

Basic Authentication Headers

HTTP Basic Authentication encodes username:password as Base64. If you're debugging auth headers, paste the token here to see the credentials (remember, Base64 is not encryption).

Data URI Creation

Create data URIs for fonts, SVGs, and small files to embed in web applications. This is useful for single-file HTML pages, email templates, and reducing dependency on external resources.

Certificate and Key Inspection

SSL certificates, PEM files, and cryptographic keys are stored in Base64-encoded format. While you can't fully parse them with this tool, you can verify the encoding is intact and see the raw binary data.

Technical Details

Base64 encoding maps every 3 bytes of input to 4 ASCII characters using a 64-character alphabet: A-Z, a-z, 0-9, + and /. The = character is used for padding when the input length isn't a multiple of 3. This means Base64 output is always exactly 4/3 the size of the input (about 33% larger).

URL-safe Base64 (also called Base64url, defined in RFC 4648) replaces + with - and / with _ to avoid conflicts with URL syntax. It optionally omits the = padding. This variant is used in JWTs, many OAuth implementations, and anywhere Base64 data appears in URLs.

The tool uses the browser's native btoa() and atob() functions for ASCII content, with a TextEncoder/TextDecoder wrapper for full UTF-8 support. This means encoding and decoding is handled by optimized browser engine code, not a JavaScript library, so it's extremely fast.

For UTF-8 content, the encoding process first converts the string to a UTF-8 byte sequence, then Base64-encodes those bytes. Decoding reverses the process. This correctly handles multi-byte characters including emoji (which are 4 bytes in UTF-8), CJK characters, accented letters, and any Unicode content.

Frequently Asked Questions

What is Base64 encoding?

Base64 is a binary-to-text encoding that converts any data into ASCII characters. It uses a 64-character alphabet (A-Z, a-z, 0-9, +, /) to represent binary data as text. It's used everywhere: email attachments, data URIs in HTML/CSS, JWT tokens, API payloads, and file encoding.

Why is Base64 data about 33% larger than the original?

Base64 encodes 3 bytes of input into 4 ASCII characters. Each character represents 6 bits instead of 8, so you need more characters to represent the same data. The ratio is exactly 4:3, which means the output is always about 33.3% larger than the input.

Is Base64 encryption? Is it secure?

No. Base64 is an encoding scheme, not encryption. Anyone can decode Base64 — there's no key, no secret, no security. Never use Base64 to protect sensitive data. It's designed for safe data transport (ensuring binary data survives text-only channels), not for confidentiality.

What's the difference between Base64 and URL-safe Base64?

Standard Base64 uses + and / characters, which have special meaning in URLs. URL-safe Base64 (Base64url) replaces + with - and / with _, making it safe to use in URLs, filenames, and query parameters. JWT tokens always use URL-safe Base64.

Can I encode files to Base64?

Yes. You can paste file contents as text for encoding. For creating data URIs for images, the format is: data:[mime-type];base64,[encoded-data]. For example, a PNG image would start with data:image/png;base64, followed by the Base64-encoded file bytes.

Why do I see '==' at the end of Base64 strings?

The = character is padding. Base64 processes input in 3-byte blocks. If the input isn't evenly divisible by 3, padding is added: one = if there's one spare byte, two == if there are two spare bytes. Some implementations (especially URL-safe Base64) omit the padding since the decoder can infer it.

Is my data safe when encoding/decoding here?

Yes. Everything happens in your browser using native JavaScript APIs. Your data is never sent to any server, never logged, and never stored. This tool works even when you're offline — disconnect from the internet and try it.

Can Base64 handle non-English text and emoji?

Yes. This tool fully supports UTF-8 encoding, so you can encode and decode text in any language — Chinese, Japanese, Arabic, Cyrillic, emoji, and any Unicode characters. The text is first converted to UTF-8 bytes, then those bytes are Base64-encoded.

What's the maximum input size?

There's no hard limit since all processing happens in your browser. In practice, inputs up to several megabytes are handled smoothly. Very large inputs (10MB+) may cause a brief pause while the browser processes the data.

How do I decode a Base64 image?

If you have a data URI (starting with data:image/...), you'll need to remove the prefix before the Base64 data. Paste just the Base64 portion (after the comma) and decode it. The result will be binary data representing the image file.

Related Tools