1. Converter Tools > 
  2. Dev Tools > 
  3. Base64 Encode and Decode

Base64 Encode and Decode

Encode text to Base64 or decode Base64 to text. UTF-8 safe. Use the mode switch to choose encode or decode. Input limited to 5MB. Copy result to clipboard.

Encode text to Base64 or decode Base64 to text on one page. Use the Mode dropdown to switch between Encode (text → Base64) and Decode (Base64 → text). Paste or type your input and click the button. The tool uses UTF-8, so Unicode characters (e.g. accented letters, emoji) are supported. Input is limited to 5 MB. Copy the result with the Copy button. Base64 is commonly used for embedding binary data in URLs, email, or JSON.

Loading…

Advertisement

Examples

  • Hello → SGVsbG8= (encode)
  • SGVsbG8= → Hello (decode)
  • Hello World → SGVsbG8gV29ybGQ= (encode)

FAQ

What is Base64?

Base64 encodes binary data as ASCII text using 64 characters (A-Z, a-z, 0-9, +, /). It is often used for embedding data in URLs or JSON. Decoding converts the Base64 string back to the original data (e.g. UTF-8 text).

Does it support Unicode?

Yes. The tool encodes and decodes UTF-8 text. Non-ASCII characters (e.g. é, 中文) are handled correctly.

What is the output padding?

Base64 uses = for padding so the length is a multiple of 4. The tool follows standard Base64 encoding.

Why do I get 'Invalid Base64' when decoding?

The input must be valid Base64 (A-Z, a-z, 0-9, +, /, and = for padding). Remove spaces or line breaks if you pasted from a wrapped format.

What is URL-safe Base64?

Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 replaces + with - and / with _, producing strings safe to use directly in URLs and filenames without percent-encoding.

How does Base64 work in data URIs?

Data URIs embed file content directly in HTML or CSS: data:image/png;base64,iVBORw0KGgo…. Encode a small image to Base64 and paste it into a src attribute to include it inline without a separate HTTP request.

What are the parts of a JWT token?

A JWT has three Base64url-encoded parts separated by dots: header.payload.signature. The header and payload are JSON objects. Decode the header or payload here to read the algorithm and claims — but remember the signature is not verified by this tool.

How does Base64 appear in email attachments?

Email attachments use MIME encoding. Binary files (images, PDFs) are Base64-encoded in the email body. The encoded data is split into 76-character lines. This is why forwarded emails sometimes show large blocks of seemingly random text.

How much does Base64 increase file size?

Base64 encodes 3 bytes as 4 characters, adding about 33% overhead. A 1 MB file becomes roughly 1.37 MB when Base64-encoded. This is the main reason not to use Base64 for large files in web APIs.

Is Base64 encryption?

No. Base64 is encoding, not encryption. Anyone can decode a Base64 string without a key. Never rely on Base64 to hide sensitive data. Use proper encryption (AES, RSA) for security.

How do I decode a Base64 image?

Remove the data URI prefix if present (e.g. remove 'data:image/png;base64,'). Paste the remaining string and decode. You'll get the raw binary content. To view it, re-add the data URI prefix and paste into a browser address bar.

How is Base64 used in HTTP Basic Auth?

HTTP Basic Authentication encodes credentials as Base64: btoa('username:password') → Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=. This is not secure on its own — always use HTTPS, and prefer token-based auth.

Advertisement

Related

  • Password Generator
  • QR Code Generator
  • Regex Tester
  • UUID Generator
Ad
Converter Tools

  • Home


    • Conversions
      • Length Converter
      • Area Converter
      • Volume Converter
      • Color Converter
      • Weight Converter
      • Temperature Converter
      • Angle Converter
      • Time Converter
      • Data Size Converter
      • Energy Converter
      • Number Base Converter
    • Calculators
      • Lengths
        • Feet and Inches Calculator
        • Pythagorean Theorem Calculator
        • Circle Circumference Calculator
        • Circle Area Calculator
        • Triangle Area Calculator
        • Rectangle Area and Perimeter Calculator
      • Percentages
        • What is X% of Y Calculator
        • X is What Percent of Y Calculator
        • Percentage Change Calculator
        • Add or Subtract Percentage Calculator
      • Time
        • Age Calculator
        • Date Difference Calculator
        • Day of Week Calculator
        • Countdown Calculator
        • Week Number Calculator
      • Body indices
        • BMR Calculator
        • TDEE Calculator
        • Ideal Weight Calculator
        • Body Fat Percentage Calculator
        • Waist-to-Hip Ratio Calculator
        • Calorie Deficit Calculator
        • BMI Calculator
      • Finance
        • Tip Calculator
        • Discount Calculator
        • Simple Interest Calculator
        • Compound Interest Calculator
        • Loan Payment (EMI) Calculator
      • Math
        • Quadratic Equation Solver
        • Factorial Calculator
        • GCD and LCM Calculator
        • Prime Number Checker
    • Dev Tools
      • Base64 Encode and Decode
      • Password Generator
      • QR Code Generator
      • Regex Tester
      • UUID Generator
    • Images
      • Image Conversions
      • Image Compression
      • Image Resize
      • Image Grayscale
      • EXIF Reader
      • Image Filters
      • Edge Detection
      • Image Crop
      • Image Rotate & Flip
      • Image Format Info
      • Image Thumbnail
    • File conversions
      • CSV and Excel Converter
    • PDF editing
      • Merge PDFs
      • Split PDF
      • Extract PDF pages
      • Rotate PDF pages
      • Add watermark to PDF
      • PDF metadata
    • Cheatsheets
      • CSS
        • CSS Color Cheatsheet
        • CSS Common Properties Cheatsheet
        • CSS Flexbox Cheatsheet
        • CSS Grid Cheatsheet
      • HTML
        • HTML Cheatsheet
      • Markdown
        • Markdown Cheatsheet
      • Git
        • Git Cheatsheet
      • Regex
        • Regex Cheatsheet
      • Time
        • Unix Timestamp Cheat
    • About
    • Contact
    • Privacy Policy
    • Terms of Use

        Built with by Hugo

        We use cookies and similar technologies for ads (e.g. Google AdSense) and analytics. By continuing you consent to our Privacy Policy. You can change preferences anytime.