Base64 of “foob” (two padding characters)
- Encoding
- Base64
- Direction
- Encode
- লেখা
- foob
- ফলাফল
- Zm9vYg==
- UTF-8 bytes
- 4
- Result length
- 8 characters
যাচাইয়ের উৎস: RFC 4648 §10 test vectors; Python 3.8 base64.b64encode(b'foob') and len() of input and output
Encode or decode Base64, URL-safe Base64, URL percent-encoding, HTML entities, hex bytes and Unicode code points, with UTF-8 and UTF-16 byte counts.
হালনাগাদ যাচাই করা উদাহরণ: ১৭
17 characters become 21 UTF-8 bytes; as Base64 they take 28 characters, 1.33 per byte.
17 characters → 21 bytes.
First group: 43 61 66 → 010000 110110 000101 100110 → 16, 54, 5, 38 → “Q2Fm”.
Every scheme here starts from the text's UTF-8 bytes. Base64 regroups each 3 bytes into four 6-bit values drawn from a 64-character alphabet (RFC 4648), so the output is 4 × ⌈n ÷ 3⌉ characters. Percent-encoding writes every byte outside A–Z, a–z, 0–9 and - . _ ~ as %XX (RFC 3986), HTML escaping replaces & < > " and ' with character references, and hex writes two digits per byte.
Developers use it to put binary data in JSON or email, build query strings, read JWTs and track down character-set problems. The default, "Café & crème, 5 €", is 17 characters but 21 UTF-8 bytes, because é and è take 2 bytes each and € takes 3, and its Base64 form is 28 characters.
A decoding error names the bad character and its position, and bytes that aren't valid UTF-8 show as U+FFFD (�).
যাচাইয়ের উৎস: RFC 4648 §10 test vectors; Python 3.8 base64.b64encode(b'foob') and len() of input and output
যাচাইয়ের উৎস: RFC 4648 §10: BASE64("") = ""
যাচাইয়ের উৎস: Python 3.8 base64.urlsafe_b64encode(b'<<???>>').rstrip(b'=') (10 characters); the standard alphabet gives PDw/Pz8+Pg==
যাচাইয়ের উৎস: Python 3.8 base64.b64decode('5L2g5aW9IOS4lueVjA==').decode('utf-8'); len() of the text, its UTF-8 bytes and its UTF-16-LE bytes ÷ 2
Base64 carries 6 bits in each output character against 8 bits in each input byte, so every 3 bytes become 4 characters, a ratio of 4 to 3, plus up to 2 = padding characters at the end. 21 bytes become 28 characters, and 1 MB of binary becomes about 1.33 MB. MIME email (RFC 2045) also breaks the output into lines of at most 76 characters, which adds a little more.
Base64URL (RFC 4648 §5) replaces the two characters that clash with URLs and file names, + and /, with - and _, and usually drops the = padding. JSON Web Tokens (RFC 7519) use it for all three of their parts. The text <<???>> is PDw/Pz8+Pg== in standard Base64 and PDw_Pz8-Pg in the URL-safe form, 10 characters instead of 12.
No. Base64 is a reversible encoding with no key, so anyone can decode it in one step; it only makes binary data safe to carry as text. HTTP Basic authentication (RFC 7617), for example, sends user:password in Base64, which is why it is only safe over HTTPS. To protect data, encrypt it first, for example with AES-256, and then Base64-encode the ciphertext if it must travel as text.
Both appear, in different places. RFC 3986, which governs URLs, encodes a space as %20, while HTML form submissions (application/x-www-form-urlencoded) write it as +. So a+b in a form's query string means a b, but in a URL path the + is a literal plus. JavaScript's encodeURIComponent gives %20, and Python's urllib.parse.quote_plus gives +.
One to four. Code points below U+0080 (ASCII) take 1 byte, those up to U+07FF take 2 (é, ñ, Greek, Cyrillic), those up to U+FFFF take 3 (€ and most Chinese characters) and the rest take 4, including emoji such as 😀 (U+1F600). So A€😀 is 3 characters, 8 UTF-8 bytes and 4 UTF-16 code units, because 😀 needs a surrogate pair in UTF-16 (RFC 3629).
নির্ভুলতা আপনার ইনপুট ও পদ্ধতির অনুমানের ওপর নির্ভর করে। দশমিক গণনায় 50টি সার্থক অঙ্ক ব্যবহৃত হয়, কিন্তু আনুমানিক হিসাব, সংখ্যাগত পদ্ধতি ও উৎসের তথ্য কম নির্ভুল হতে পারে; প্রদর্শিত মান রাউন্ড করলে এই সীমাবদ্ধতাগুলি দূর হয় না। স্বতন্ত্র উৎসের সমাধানের সঙ্গে যাচাই করা উদাহরণ: ১৭। যেমন, “Base64 of “foob” (two padding characters)” উদাহরণটি RFC 4648 §10 test vectors; Python 3.8 base64.b64encode(b'foob') and len() of input and output-এর সঙ্গে যাচাই করা হয়।
RFC 4648 — The Base16, Base32, and Base64 Data Encodings; RFC 3986 §2 — URI characters and percent-encoding; RFC 3629 — UTF-8, a transformation format of ISO 10646; WHATWG HTML — Named character references; The Unicode Standard, §3.9 Unicode encoding forms.
এই ক্যালকুলেটরে স্বাধীন উৎস থেকে উত্তর নেওয়া ১৭টি সমাধান করা উদাহরণ রয়েছে। এগুলি পরীক্ষার সমষ্টিতে চালানো হয়, আর আপনি এখানেও চালাতে পারেন।
Generate MD5, SHA-1, SHA-256, SHA-512 and CRC-32 hashes of any text, check them against a published checksum, and see the avalanche effect.
Convert numbers between binary, decimal, hex, octal and any base 2–36, including fractions, repeating digits and two's-complement bits for negatives.
Format (pretty-print) or minify JSON and validate it against RFC 8259, with the line and column of any syntax error explained in plain words.
Generate reproducible UUID v4 and v7 values from a seed, or validate any UUID or GUID and decode its version, variant and embedded timestamp.