الترميز
Base64
ترميز وفك ترميز Base64 — نص وملفات، مباشرة في المتصفح.
Base64 is a binary-to-text encoding that represents arbitrary bytes using 64 printable ASCII characters (A–Z, a–z, 0–9, plus + and /). It exists so binary data — images, archives, cryptographic keys — can pass unchanged through channels that were designed for text only.
This tool encodes and decodes both plain text and files. Everything runs client-side in your browser: the input never leaves your machine, which makes it safe for tokens, private keys, and other sensitive data.
How to use it
- Encode text: pick the Encode / Text mode, paste your string, and copy the Base64 result.
- Encode a file: switch to File mode and choose a file — you get its Base64 representation, ready for a data URI or JSON field.
- Decode: switch to Decode mode and paste a Base64 string; if it decodes to a known file type you can download the original file.
Common uses
- Embedding small images or fonts directly in CSS/HTML via data: URIs.
- Putting binary payloads inside JSON, XML, or form fields.
- Encoding credentials for the HTTP Basic Authorization header.
- Storing or transmitting PEM keys and certificates.
Things to keep in mind
Base64 is not encryption — anyone can decode it. It only changes the representation of data, not its confidentiality.
Encoded output is about 33% larger than the input because every 3 bytes become 4 characters.
For URLs and file names use Base64URL, which swaps + and / for - and _ and often drops the = padding.
الأسئلة الشائعة
ما هو Base64 ومتى أحتاج إليه؟
Base64 طريقة لتمثيل بيانات ثنائية (صور، ملفات) كنص باستخدام 64 رمزًا فقط، لتتمكن من تمرير هذه البيانات في أماكن تفهم النص فقط، مثل JSON أو رؤوس HTTP أو رسائل البريد الإلكتروني.
لماذا يكون ناتج الترميز أطول من النص الأصلي؟
لأن كل 3 بايتات من البيانات الأصلية تتحول إلى 4 أحرف Base64، أي زيادة في الحجم بنسبة تقارب 33٪. هذا أمر طبيعي وليس خطأ في الأداة.
هل يتم رفع الملف أو النص إلى خادم عند استخدام هذه الأداة؟
لا، كل عمليات الترميز وفك الترميز تتم محليًا داخل متصفحك عبر JavaScript، ولا تُرسل أي بيانات إلى أي خادم في أي مرحلة.
ما الفرق بين Base64 القياسي وBase64URL؟
في Base64URL يُستبدل الرمزان + و/ بـ- و_، لتتمكن من إدراج السلسلة بأمان داخل عنوان URL أو اسم ملف دون الحاجة إلى percent-encoding إضافي. وهذا هو البديل الذي يستخدمه JWT.
ماذا يعني الرمز = في نهاية السلسلة؟
إنه رمز حشو (padding) يوضح عدد البايتات الناقصة في الكتلة الأخيرة المكوّنة من 3 بايتات. وهو ليس إلزاميًا دائمًا — فبعض الأنظمة تتجاهله عمدًا.