Base64 Encode / Decode

Free

Encode and decode Base64 strings instantly in your browser. Convert text or files to Base64 and back — no server upload, no data collection. Free, private, and works offline.

Your files never leave your browser. All processing happens client-side via WebAssembly.
Encoding
Base64 Output
Output will appear here...

How to Base64 Encode / Decode Online

1

Choose Text or File mode, then select Encode or Decode direction.

2

Enter your text or upload a file to convert.

3

Click Encode or Decode, then copy the result or download it.

Base64 Encode / Decode — Frequently Asked Questions

About Base64 Encode / Decode

What Is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data as an ASCII string. It converts every 3 bytes of input into 4 printable characters using a 64-character alphabet (A-Z, a-z, 0-9, +, /). Base64 is used everywhere in modern software — embedding images in HTML/CSS, encoding email attachments (MIME), transmitting binary data in JSON APIs, storing cryptographic keys, and encoding authentication tokens (like JWTs).

Why Use PDFJolt's Base64 Tool?

Privacy-first processing. Unlike online Base64 converters that send your data to a server, PDFJolt encodes and decodes everything directly in your browser using JavaScript's built-in btoa() and atob() functions. Your API keys, authentication tokens, and sensitive data never leave your device.

Key Features

  • Text mode — Type or paste text to encode, or paste Base64 to decode. Instant conversion with one click.
  • File mode — Upload any file to get its Base64 representation, or paste Base64 to decode back to a file download.
  • Swap direction — Toggle between encode and decode with one click. Output becomes the new input automatically.
  • Copy and download — Copy Base64 output to clipboard or download as a file.
  • Full Unicode support — Correctly handles UTF-8 characters including emojis, accented characters, and CJK text.

Common Use Cases

Embedding Images in CSS/HTML

Convert small images (icons, logos) to Base64 data URIs to eliminate HTTP requests. Paste the Base64 output directly into your CSS background-image: url(data:image/png;base64,...) or HTML <img src="data:image/png;base64,...">.

Working with APIs

Many APIs require Base64-encoded payloads — file uploads in JSON, Basic Authentication headers (Authorization: Basic base64(user:pass)), and webhook signatures. Use PDFJolt to quickly encode or decode these values during development.

Debugging JWTs and Tokens

JSON Web Tokens (JWTs) use Base64url encoding for their header and payload segments. Decode the token's segments to inspect claims, expiration times, and issuer information without using a third-party JWT debugger that might log your tokens.

Email Attachments (MIME)

Email protocols encode binary attachments as Base64 within MIME messages. Decode raw email source to extract attachments, or encode files to embed them in automated email systems.

Base64 Encoder vs. Competitors

FeaturePDFJoltbase64encode.orgbase64decode.orgcodebeautify.org
Client-side onlyYesNo (server)No (server)No (server)
File uploadYesYesNoYes
Unicode supportFull UTF-8LimitedLimitedLimited
No adsYesNoNoNo
Works offlineYesNoNoNo
Privacy100% localServer-sideServer-sideServer-side

Technical Details

PDFJolt uses JavaScript's native btoa() and atob() functions for encoding and decoding. For full Unicode support, input is first encoded with encodeURIComponent() and unescape() to handle multi-byte characters correctly. This ensures that emojis, accented characters, and non-Latin scripts encode and decode without data loss.

Base64 Encoding Overhead

Base64 encoding increases data size by approximately 33% — every 3 bytes of input produce 4 bytes of output. This is the trade-off for converting binary data to a text-safe format. For large files, consider whether Base64 encoding is necessary, or if direct binary transmission would be more efficient.

Tips

  • Use Base64 for small assets (under 10 KB) to reduce HTTP requests. For larger files, regular file hosting is more efficient.
  • Base64 is not encryption — it provides no security. Never use Base64 alone to protect sensitive data.
  • When working with URLs, use Base64url encoding (replace + with -, / with _, and remove = padding) for URL-safe strings.
  • If your decoded output looks garbled, the original data may have been binary (an image, PDF, etc.) rather than text.