🧬

Base64 Encoder/Decoder

Encode and decode Base64 strings with UTF-8 support. Supports standard Base64 and Base64URL. Perfect for encoding text, handling API tokens, embedding data URIs, and debugging web applications.

Security ToolsDevelopment
Loading tool...

How to Use Base64 Encoder/Decoder

How to Use the Base64 Encoder/Decoder:

  1. Select Mode: Choose Encode to convert plain text to Base64, or Decode to convert a Base64 string back to plain text. The mode label on the input area updates to reflect your selection.

  2. Choose Standard or Base64URL: Toggle the Base64URL switch to convert between standard Base64 (uses + and / characters) and URL-safe Base64URL (replaces + with - and / with _, removes = padding). Use Base64URL for JWT tokens, URL parameters, and filenames.

  3. Enter Input: Type or paste your text (for encoding) or your Base64 string (for decoding) into the input area. The tool handles emoji, international characters, and all Unicode text correctly using UTF-8.

  4. Click Convert: Click the Convert button to perform the encoding or decoding. The result appears in the output area immediately.

  5. Copy Output: Click Copy Output to copy the result to your clipboard. A confirmation toast appears when the copy succeeds.

  6. Swap: Use the Swap button to move the current output into the input field and switch modes — useful for round-trip testing (encode then decode to verify).

  7. Try a Sample: Click Sample to load an example input with UTF-8 characters including emoji. The conversion runs automatically so you can see what the output looks like.

  8. Clear: Click Clear to reset all fields and start fresh.

Common Use Cases:

  • API authentication: Encode Basic Auth credentials (username:password) for HTTP Authorization headers
  • Data URIs: Embed small images or files directly in HTML/CSS using Base64-encoded data
  • JWT inspection: Decode the header and payload segments of a JWT (each is Base64URL-encoded)
  • Email MIME content: Decode Base64-encoded email attachment content
  • Debugging: Decode Base64 tokens, cookies, or configuration values to inspect their content
  • URL-safe encoding: Use Base64URL mode for values passed in query strings or URL path segments

Tips and Best Practices:

  • Base64 is encoding, not encryption — anyone can decode it instantly; never use it for security
  • Base64 increases data size by approximately 33% (3 bytes → 4 characters)
  • Always remove whitespace and newlines from Base64 strings before decoding
  • Standard Base64 uses + and / which must be percent-encoded in URLs; use Base64URL instead
  • The = padding at the end of a Base64 string is optional in many contexts but required by strict decoders
  • For JWT tokens, the header and payload are Base64URL-encoded; the signature is also Base64URL but cannot be decoded to meaningful text without verifying it

Frequently Asked Questions

Most Viewed Tools

📺

Screen Size Converter

710 views

Calculate screen width and height from diagonal size and aspect ratio. Convert between inches and centimeters for displays, TVs, and monitors with instant dimension calculations.

Use Tool →
🖨️

DPI Calculator

290 views

Calculate DPI (dots per inch), image dimensions, and print sizes. Convert between pixels and physical dimensions for printing and displays.

Use Tool →
📄

Paper Size Converter

251 views

Convert between international paper sizes (A4, Letter, Legal) with dimensions in mm, cm, and inches. Compare ISO A/B series and North American paper standards.

Use Tool →

Fuel Consumption Converter

237 views

Convert between MPG (miles per gallon), L/100km (liters per 100 kilometers), and other fuel efficiency units. Compare car fuel economy across different measurement systems.

Use Tool →
✂️

CSV Splitter

226 views

Split large CSV files into smaller files by number of rows. Process large datasets in manageable chunks instantly.

Use Tool →
🛍️

Product Schema Generator

206 views

Generate JSON-LD Product schema markup for SEO. Add product details like name, price, brand, rating, and availability to create structured data for rich search results.

Use Tool →
📄

Large Text File Viewer

175 views

View and search large text files up to 200MB in your browser. Features virtual scrolling, line numbers, search functionality, and file statistics. Perfect for log files, CSV, JSON, and code files.

Use Tool →
🔑

API Key Generator

162 views

Generate secure, cryptographically random API keys for authentication and authorization. Create custom API keys with various formats including hex, base64, and prefixed keys.

Use Tool →

Related Development Tools

Share Your Feedback

Help us improve this tool by sharing your experience

We will only use this to follow up on your feedback