Enkode
Base64
Encode dan decode Base64 — teks dan file, langsung di browser.
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.
Artikel tentang alat ini: Base64: untuk apa enkode dan bagaimana cara kerjanya
Pertanyaan yang sering diajukan
Apa itu Base64 dan kapan sebaiknya dipakai?
Base64 mengubah data biner menjadi teks ASCII memakai 64 karakter (A-Z, a-z, 0-9, +, /) plus padding "=". Cocok saat perlu menyisipkan data biner (gambar, file) ke tempat yang hanya menerima teks, misalnya JSON, email, atau atribut HTML.
Kenapa hasil Base64 lebih panjang dari file aslinya?
Setiap 3 byte data biner diubah menjadi 4 karakter teks, jadi ukurannya membengkak sekitar 33%. Ini normal dan bukan tanda ada yang salah.
Apakah file yang saya encode/decode di sini terkirim ke server?
Tidak. Semua proses encode dan decode berjalan langsung di browser Anda memakai JavaScript, tidak ada file atau teks yang diunggah ke server mana pun.
Apa bedanya Base64 standar dengan Base64URL?
Pada Base64URL, karakter + dan / diganti dengan - dan _ agar string bisa disisipkan dengan aman ke URL atau nama berkas tanpa percent-encoding tambahan. Varian inilah yang dipakai JWT.
Apa arti karakter = di akhir string?
Itu adalah padding yang menunjukkan berapa byte yang kurang di blok 3-byte terakhir. Padding ini tidak selalu wajib — beberapa sistem sengaja membuangnya.