Text Case Converter

Change text case in one click.

Configure inputs in pipeline.

Output will appear here.

For informational purposes only.

No data is stored or transmitted.

(function(){ const input = document.querySelector('#input'); const display = document.querySelector('.result'); const actions = { 'btn-lower': (t)=> t.toLowerCase(), 'btn-upper': (t)=> t.toUpperCase(), 'btn-title': (t)=> t.replace(/\w\S*/g, (w)=> w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()), 'btn-sentence': (t)=> t.replace(/(^\s*|[.!?]\s+)([a-z])/g, (_,p,c)=> p + c.toUpperCase()) }; Object.entries(actions).forEach(([id, fn])=>{ const btn = document.getElementById(id); if(btn) btn.addEventListener('click', ()=>{ if(display) display.textContent = fn(input?.value || ''); }); }); const copyBtn = document.getElementById('btn-copy'); if(copyBtn) copyBtn.addEventListener('click', async ()=>{ try{ await navigator.clipboard.writeText(display?.textContent || ''); copyBtn.textContent='Copied'; setTimeout(()=>copyBtn.textContent='Copy result', 900); }catch(e){} }); })();