Converter

बेस64 एनकोड/डीकोड

टेक्स्ट या फ़ाइलों को बेस64 में एनकोड करें और बेस64 स्ट्रिंग्स को वापस टेक्स्ट या फ़ाइलों में डिकोड करें, पूरी तरह से ब्राउज़र में। यह पूरी तरह से आपके ब्राउज़र में चलता है — किसी भी सर्वर पर कोई डेटा नहीं भेजा जाता है, किसी खाते की आवश्यकता नहीं है, और यह पूरी तरह से मुफ़्त है।

बेस64 एन्कोडिंग और डिकोडिंग के लिए संपूर्ण गाइड

बेस64 इंटरनेट पर सबसे चुपचाप व्यापक प्रौद्योगिकियों में से एक है। यदि आपने कभी सीएसएस फ़ाइल में एक छवि एम्बेड की है, एक ईमेल अनुलग्नक भेजा है, प्रमाणीकरण टोकन संभाला है, या किसी वेब एपीआई के साथ काम किया है, तो आपने लगभग निश्चित रूप से बेस 64 एन्कोडिंग का सामना किया है - अक्सर इसे साकार किए बिना। इस व्यापक गाइड में, हम बेस64 के रहस्य को उजागर करते हुए बताते हैं कि यह कैसे काम करता है, इसका उपयोग कहाँ किया जाता है, और यह प्रत्येक डेवलपर के लिए एक आवश्यक उपकरण क्यों बना हुआ है।

बेस64 क्या है और यह क्यों मौजूद है?

कंप्यूटर मूल रूप से बाइनरी में संचार करते हैं - 0 और 1 के अनुक्रम बाइट्स में व्यवस्थित होते हैं। हालाँकि, कई पुराने टेक्स्ट-आधारित प्रोटोकॉल (जैसे ईमेल के लिए SMTP, या इसके शुरुआती रूपों में HTTP) केवल 7-बिट ASCII टेक्स्ट को संभालने के लिए डिज़ाइन किए गए थे। जब आप केवल ASCII टेक्स्ट के लिए डिज़ाइन किए गए चैनल के माध्यम से कच्चे बाइनरी डेटा (जैसे एक छवि फ़ाइल या संकलित प्रोग्राम) को प्रसारित करने का प्रयास करते हैं, तो प्रिंट करने योग्य ASCII रेंज के बाहर आने वाले बाइट्स पूरी तरह से खराब हो जाते हैं या छीन लिए जाते हैं।

बेस64 इस समस्या का समाधान करता है मनमाने बाइनरी डेटा को 64 मुद्रण योग्य ASCII वर्णों के एक सुरक्षित सेट में परिवर्तित करके: अपरकेस अक्षर A-Z, लोअरकेस अक्षर a-z, अंक 0-9, और प्रतीक + और / (साथ = पैडिंग के रूप में उपयोग किया जाता है)। यह गारंटी देता है कि एन्कोडेड डेटा बिना किसी भ्रष्टाचार के किसी भी टेक्स्ट-आधारित सिस्टम से गुजर सकता है।

बेस64 एन्कोडिंग कैसे काम करती है?

एन्कोडिंग प्रक्रिया सुरुचिपूर्ण और व्यवस्थित है:

  1. बाइट्स को त्रिक में समूहित करें: कच्चा बाइनरी इनपुट लें और बाइट्स को 3 (कुल 24 बिट्स) के सेट में समूहित करें।
  2. चार 6-बिट समूहों में विभाजित करें: Each 24-bit triplet is split into four 6-bit groups (since 2⁶ = 64, each group maps to one of the 64 characters).
  3. Look up the character: Each 6-bit value (0–63) is mapped to its corresponding Base64 character using the Base64 alphabet.
  4. Padding: If the input is not a multiple of 3 bytes, one or two = characters are appended as padding to ensure the output length is a multiple of 4.

The result: every 3 bytes of input produce exactly 4 Base64 characters of output, explaining the ~33% size overhead inherent in Base64 encoding.

Where is Base64 Used in the Real World?

1. Email Attachments (MIME)

The MIME (Multipurpose Internet Mail Extensions) standard uses Base64 to encode binary file attachments — images, PDFs, and documents — so they can be safely transmitted as part of a plain-text email message. When you attach a file to a Gmail message, your email client Base64-encodes it before sending.

2. Embedding Images in HTML and CSS

Instead of serving a separate image file (which requires a separate HTTP request), you can embed small images directly into HTML or CSS as a Base64 data URI:

<img src="data:image/png;base64,iVBORw0KGgoAAAANS..." />

This is useful for small icons, loading spinners, and critical above-the-fold images to eliminate render-blocking requests.

3. HTTP Basic Authentication

When a browser sends HTTP Basic Auth credentials, it Base64-encodes the username:password string and sends it in the Authorization header: Authorization: Basic dXNlcjpwYXNz. Importantly, Base64 is encoding, not encryption — it is trivially reversible and provides zero security by itself. Always use HTTPS when transmitting Basic Auth credentials.

4. JSON Web Tokens (JWT)

JWTs consist of three Base64url-encoded segments separated by dots: the header, the payload (claims), and the signature. The "url-safe" variant replaces + with - and / with _ so the token can be safely included in URLs and HTTP headers without URL-encoding.

5. Cryptographic Outputs

Many cryptographic operations (hashing, encryption, digital signatures) produce raw binary output. Base64 is the standard way to represent these outputs as printable strings in configuration files, databases, and API responses.

Base64 vs. URL-Safe Base64

Standard Base64 uses characters (+ and /) that have special meaning in URLs. URL-safe Base64 (also called Base64url) substitutes these with - and _, making the encoded string safe to use in URL query parameters and path segments without requiring percent-encoding.

Security Reminder

Base64 is an encoding scheme, not an encryption scheme. Anyone who receives a Base64-encoded string can decode it instantly. Never use Base64 as a method of securing sensitive data. For actual security, use proper encryption (AES-256) or cryptographic hashing (SHA-256).

Use our free, private Base64 Encoder/Decoder to quickly encode text, decode API tokens, inspect JWTs, and work with data URIs — all processed entirely in your browser.

का उपयोग कैसे करें बेस64 एनकोड/डीकोड

  1. 1

    Choose encode or decode

    Select Encode to convert plain text to Base64, or Decode to convert a Base64 string back to text.

  2. 2

    Enter your input

    Paste the text or Base64 string you want to convert into the input area.

  3. 3

    Convert and copy

    Click Encode or Decode, then copy the output to your clipboard.

अक्सर पूछे जाने वाले प्रश्न

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is widely used to embed binary data in text-based formats like JSON, XML, HTML, and email.

Why does Base64 make data larger?

Base64 encoding expands data by approximately 33% because every 3 bytes of input become 4 characters of output. This is the expected overhead and is fine for transmission purposes.

What is the difference between Base64 and URL-safe Base64?

Standard Base64 uses + and / characters which are special in URLs. URL-safe Base64 replaces these with - and _ so the encoded string can be safely used in URLs without encoding.

Can this tool handle Unicode/emoji characters?

Yes. The tool uses TextEncoder/TextDecoder to properly handle UTF-8 Unicode text including emoji, Chinese, Arabic, and all other character sets before encoding to Base64.

Is my data sent anywhere?

No. Base64 encoding and decoding use the built-in browser functions (btoa/atob) combined with TextEncoder. Nothing leaves your browser.

शेयर करें: