🔄 Base64 Encoder & Decoder

Encode or decode Base64 text and files instantly. Supports images, PDFs, and any binary file. 100% browser-based Base64 encoder — your data never leaves your device.

How to Use

1

Choose mode

Select Text mode for plain text encoding/decoding, or File mode to encode any file.

2

Enter your input

Type or paste text, then click Encode or Decode. For files, drag and drop or click to browse.

3

Copy the output

Click Copy to copy the Base64 output to your clipboard for use in your project.

Frequently Asked Questions

What is Base64 encoding? +
Base64 converts binary data (like images or files) into ASCII text using 64 characters (A–Z, a–z, 0–9, +, /). It's used to embed images in CSS/HTML, transmit data in JSON APIs, and store binary data in text formats.
How do I use Base64 images in CSS? +
After encoding an image, copy the output and use it as: background-image: url('data:image/png;base64,YOUR_BASE64_HERE'). This embeds the image directly in your CSS, eliminating an HTTP request.
Is Base64 encoding the same as encryption? +
No. Base64 is encoding, not encryption. Anyone can decode Base64 text instantly. Never use it to hide sensitive information.
Why does Base64 encoded text end with == ? +
Base64 pads output to a multiple of 4 characters using = signs. One = means 1 padding byte, == means 2 padding bytes.
Can I encode files to Base64? +
Yes — switch to File mode, select any file, and the tool instantly shows its Base64 representation. Works for images, PDFs, fonts, and any binary file.


Tam Rehber: Base64 Encoder & Decoder

Base64 Nedir ve Neden Önemlidir?

Base64, ikili verileri yalnızca 64 yazdırılabilir ASCII karakteriyle temsil eden bir ikili-metin kodlama şemasıdır (A–Z, a–z, 0–9, +, /). 1980'lerde yalnızca metin kabul eden kanallar (e-posta MIME, HTTP başlıkları, XML) üzerinden resim ve sertifika gibi ikili içerikleri güvenle iletmek için tasarlandı.

En önemli nokta: Base64 şifreleme değil, kodlamadır. Base64 dizisine sahip herkes onu kolayca çözebilir. Gizlilik sağlamaz. Tek amacı format uyumluluğu — ikili veriyi ham baytları yanlış işleyen sistemlerin bozamayacağı metne dönüştürmek.

Günlük karşılaştığınız yerler: HTML/CSS'e gömülü resimler (data:image/png;base64,…), HTTP Basic Auth başlıkları, JWT token'larının header ve payload kısımları, MIME e-posta ekleri.

Nasıl Kullanılır?

  1. Metin veya Dosya modunu seçin.
  2. Metin modunda: metni yapıştırın, Encode veya Decode'a tıklayın.
  3. Dosya modunda: herhangi bir dosyayı (resim, PDF, font) yükleme alanına sürükleyip bırakın.
  4. Çıktıyı kopyalayın. Data URI için "Copy as Data URI" seçeneğini kullanın.

Kod Örnekleri

// Tarayıcı: metin encode/decode
const encoded = btoa('Merhaba Dünya');  // dikkat: ASCII dışı için TextEncoder kullanın
const decoded = atob(encoded);

// Node.js: binary-safe encoding
const b64 = Buffer.from('Merhaba').toString('base64');
const geri = Buffer.from(b64, 'base64').toString('utf-8');

// HTTP Basic Auth başlığı
const kimlik = btoa('kullanici:sifre');
// Authorization: Basic a3VsbGFuaWNpOnNpZnJl

// Base64url (JWT için): + yerine -, / yerine _, = kaldır
const b64url = btoa(str).replace(/\+/g,'-').replace(/\//g,'_').replace(/=/g,'');

Yaygın Hatalar

Alternatiflerle Karşılaştırma

URL encoding (percent-encoding) URL parametreleri için kullanılır — ikili veri için değil. Hex encoding, her baytı iki hex rakamıyla gösterir; hash'ler ve debug için kullanılır ama %100 ek yük getirir. Büyük dosya yüklemeleri için Base64 yerine multipart form data kullanmak daha verimlidir.

Resmi Base64 data URI'sine dönüştürmek için Image to Base64 aracını kullanın. JWT token'larını anlamak için JWT Decoder'a bakın.

İpuçları

🧰 50+ Tools