#️⃣ Add Line Numbers

Add line numbers to text with custom padding and separator.

Similar Tools

📋 How to Use

1
Input

Fill in the required parameters

2
Execute

Click the generate/execute button

3
Result

View and copy your results

About This Tool

Add line numbers to text with custom padding and separator.

How to Use

  • Enter or paste your data in the input fields above
  • Results update instantly - all processing in your browser
  • 100% free with no signup or account required

Tool Network

SkillgohubSmarttoolgoBesttoolfunQuickskillhub
function initTool() { document.getElementById('tool-app').innerHTML = '
';
}
function doIt() {
  var lines = document.getElementById('inp').value.split(String.fromCharCode(10));
  var pad = parseInt(document.getElementById('pad').value) || 0;
  var sep = document.getElementById('sep').value;
  document.getElementById('out').textContent = lines.map(function(l,i){return String(i+1).padStart(pad)+sep+l;}).join(String.fromCharCode(10));
}
function clearAll() { document.getElementById('inp').value = ''; document.getElementById('out').textContent = ''; }
window.addEventListener('DOMContentLoaded', initTool);