Encoder/Decoder

Encode and decode text using various algorithms. Base64, URL encoding, HTML entities, and more.

Input Text

Characters: 0 | Bytes: 0

Output Text

Output will appear here...
Characters: 0 | Bytes: 0

Method Information

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format.

Commonly used for encoding email attachments, images in HTML/CSS, and transferring binary data over text-based protocols.

Usage Examples

Base64
Images, email attachments, API data
URL Encoding
Web URLs, query parameters
HTML Entities
Web content, preventing XSS

Quick Actions

', unicode: 'Hello δΈ–η•Œ 🌍', binary: 'Hi!', hex: 'Hi!', morse: 'HELLO WORLD', rot13: 'Hello World' }; $('#input-text').val(samples[currentMethod] || 'Sample text'); updateCounts(); }); $('#copy-output').click(function() { const text = $('#output-text').text(); if (text && text !== 'Output will appear here...') { navigator.clipboard.writeText(text).then(() => { const btn = $(this); const originalText = btn.html(); btn.html('Copied!'); setTimeout(() => btn.html(originalText), 2000); }); } }); $('#download-output').click(function() { const text = $('#output-text').text(); if (text && text !== 'Output will appear here...') { const blob = new Blob([text], { type: 'text/plain' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = `encoded-text-${currentMethod}.txt`; a.click(); URL.revokeObjectURL(url); } }); // Quick actions $('.quick-action').click(function() { const action = $(this).data('action'); const inputText = $('#input-text').val(); try { let result; switch(action) { case 'encode-json': result = JSON.stringify(inputText); break; case 'decode-json': result = JSON.parse(inputText); break; case 'encode-xml': result = inputText.replace(/[<>&'"]/g, (char) => { const map = {'<': '<', '>': '>', '&': '&', "'": ''', '"': '"'}; return map[char]; }); break; case 'decode-xml': result = inputText.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&') .replace(/'/g, "'").replace(/"/g, '"'); break; case 'encode-csv': result = '"' + inputText.replace(/"/g, '""') + '"'; break; case 'md5-hash': // Simple hash simulation (not cryptographically secure) result = btoa(inputText).slice(0, 16); break; } $('#output-text').text(result); updateCounts(); } catch (error) { $('#output-text').text('Error: ' + error.message); } }); // Live input updates $('#input-text').on('input', updateCounts); // Initialize updateMethodInfo('base64'); updateCounts(); });