Encode UTF-8 text into standard Base64 strings and decode back locally
Encode UTF-8 text strings (including Hindi and emojis) into standard Base64 format or decode Base64 strings back into readable text inside your browser.
Base64 (standardized under RFC 4648) is a binary-to-text encoding scheme that represents raw byte sequences using a safe set of 64 printable ASCII characters (`A–Z`, `a–z`, `0–9`, `+`, and `/`, plus `=` as a trailing padding character). It works by taking every 3 bytes (24 bits) of input data, splitting those 24 bits into four 6-bit chunks, and mapping each 6-bit value (0 to 63) to its corresponding ASCII character. If the input length is not evenly divisible by 3 bytes, one or two `=` padding characters are appended at the end. Because 3 bytes of input become 4 bytes of ASCII text, Base64 encoding increases data size by approximately 33%. Developers commonly use Base64 to transmit binary payloads or multi-byte strings safely across text-only channels such as JSON APIs, MIME email attachments, XML documents, and inline HTML/CSS Data URLs.
Handling UTF-8 text (such as Hindi Devanagari script `नमस्ते`, accented letters, or emojis `🚀`) in JavaScript requires careful byte conversion. The browser's native `window.btoa()` function only accepts single-byte Latin-1 (ISO-8859-1) characters and throws an `InvalidCharacterError` (`DOMException`) if given multi-byte Unicode text directly. Our Base64 Encoder & Decoder converts your input text into UTF-8 byte sequences (`encodeURIComponent` / `unescape`) before calling `btoa()`, and reverses that exact UTF-8 byte pipeline on `atob()` when decoding, ensuring international scripts and symbols round-trip without corruption. Note also the difference between Standard Base64 (used by this tool, which includes `+`, `/`, and `=`) and URL-Safe Base64 (`base64url`, used in JWTs and URL query parameters, which substitutes `-` for `+`, `_` for `/`, and often omits `=` padding so strings do not clash with URL delimiters).
Critical Security Warning: Base64 is strictly an ENCODING format for data transport compatibility—it is NOT encryption, hashing, or password protection. Encoding a string into Base64 does not hide or secure its contents; anyone who intercepts or views a Base64 string can decode it back into plain text in milliseconds without any secret key or password. Never store plaintext passwords, private cryptographic keys, database credentials, or sensitive personal data in Base64 under the assumption that it is encrypted, and never paste production secrets into untrusted third-party websites (though this tool processes your text 100% locally inside your browser).
बेस64 (Base64 - जो RFC 4648 मानक पर आधारित है) एक बाइनरी-टू-टेक्स्ट एनकोडिंग प्रणाली है जो किसी भी डेटा या टेक्स्ट बाइट्स को 64 प्रिंट होने योग्य ASCII अक्षरों (`A–Z`, `a–z`, `0–9`, `+`, और `/`, तथा अंत में पैडिंग के लिए `=`) में बदल देती है। यह इनपुट डेटा के हर 3 बाइट्स (24 बिट्स) को 6-6 बिट्स के चार हिस्सों में बांटता है और उन्हें 64 ASCII चिन्हों में मैप करता है। यदि इनपुट बाइट्स की संख्या 3 से पूरी तरह विभाजित नहीं होती, तो अंत में एक या दो `=` चिन्ह जोड़े जाते हैं। चूंकि हर 3 बाइट डेटा 4 अक्षरों में बदल जाता है, इसलिए Base64 एनकोडिंग से डेटा का आकार लगभग 33% बढ़ जाता है। डेवलपर्स इसका उपयोग ईमेल अटैचमेंट (MIME), JSON पेलोड, और HTML/CSS डेटा यूआरएल में डेटा को बिना किसी खराबी के भेजने के लिए करते हैं।
जावास्क्रिप्ट में हिंदी (देवनागरी लिपि जैसे `नमस्ते`) या इमोजी (`🚀`) जैसे मल्टी-बाइट UTF-8 अक्षरों को Base64 में बदलते समय विशेष सावधानी की आवश्यकता होती है। ब्राउज़र का साधारण `window.btoa()` फंक्शन केवल लैटिन-1 (एकल-बाइट) अक्षरों को स्वीकार करता है और सीधे हिंदी या इमोजी डालने पर एरर (`InvalidCharacterError`) दे देता है। हमारा टूल एनकोड करने से पहले टेक्स्ट को सुरक्षित UTF-8 बाइट अनुक्रम में बदलता है और डिकोड करते समय वापस UTF-8 में परिवर्तित करता है, जिससे किसी भी भाषा का टेक्स्ट बिल्कुल सही डिकोड होता है। साथ ही, 'मानक Base64' (जिसका उपयोग यह टूल करता है और जिसमें `+`, `/` व `=` होते हैं) और 'URL-Safe Base64' (`base64url`, जिसमें यूआरएल में टूटने से बचाने के लिए `+` की जगह `-` और `/` की जगह `_` का उपयोग होता है, जैसे JWT टोकन में) के बीच का अंतर भी ध्यान में रखें।
महत्वपूर्ण सुरक्षा चेतावनी: Base64 केवल डेटा को एक फॉर्मेट से दूसरे फॉर्मेट में बदलने की 'एनकोडिंग' (Encoding) प्रक्रिया है—यह किसी भी प्रकार का 'एन्क्रिप्शन' (Encryption), हैशिंग या पासवर्ड सुरक्षा नहीं है। किसी भी संवेदनशील जानकारी को Base64 में बदलने से वह सुरक्षित या गोपनीय नहीं हो जाती; कोई भी व्यक्ति बिना किसी पासवर्ड या कुंजी (Key) के एक सेकंड में Base64 स्ट्रिंग को वापस सामान्य टेक्स्ट में डिकोड कर सकता है। इसलिए पासवर्ड, एपीआई कीज़ (API Keys) या व्यक्तिगत गोपनीय डेटा को सुरक्षित रखने के लिए कभी भी केवल Base64 पर निर्भर न रहें (हालांकि यह टूल आपके डेटा को किसी सर्वर पर भेजे बिना 100% आपके ब्राउज़र में ही प्रोसेस करता है)।