Online Legal Will & Testament Generator

Online Legal Will & Testament Generator

Create a simple last will and testament by following the steps below.

Your Information (The Testator)

Appoint an Executor

The Executor is the person who will manage your estate. You should also name an alternate.

Name Your Beneficiaries

List the people or organizations who will inherit from your estate.

Beneficiary List

Distribute Your Property

Residuary Estate

This is the remainder of your property after any specific gifts and debts are paid.

Review Your Will

Click "Generate Preview" to see your document.

No beneficiaries added yet.

'; return; } state.beneficiaries.forEach((b, index) => { const el = document.createElement('div'); el.className = 'flex justify-between items-center p-3 bg-white rounded-lg border text-sm'; el.innerHTML = `

${b.name}

${b.relation}

`; beneficiaryList.appendChild(el); }); } // --- CORE FUNCTIONS --- window.showTab = function(tabIndex) { if (tabIndex < 0 || tabIndex >= tabButtons.length) return; state.currentTab = tabIndex; tabButtons.forEach((btn, i) => btn.classList.toggle('active', i === state.currentTab)); tabContents.forEach((content, i) => content.classList.toggle('active', i === state.currentTab)); updateNavButtons(); }; function updateNavButtons() { if (prevBtn) prevBtn.disabled = state.currentTab === 0; if (nextBtn) nextBtn.disabled = state.currentTab === tabButtons.length - 1; } window.removeBeneficiary = function(index) { state.beneficiaries.splice(index, 1); renderBeneficiaries(); } function generateWillText() { const testatorName = document.getElementById('testator-name').value || '[Testator Name]'; const testatorCity = document.getElementById('testator-city').value || '[City]'; const testatorCounty = document.getElementById('testator-county').value || '[County]'; const testatorState = stateSelect.value || '[State]'; const executorName = document.getElementById('executor-name').value || '[Executor Name]'; const altExecutorName = document.getElementById('alt-executor-name').value || '[Alternate Executor Name]'; const residuaryClause = document.getElementById('residuary-clause').value; state.willText = ` LAST WILL AND TESTAMENT OF ${testatorName.toUpperCase()} I, ${testatorName}, a resident of ${testatorCity}, County of ${testatorCounty}, State of ${testatorState}, being of sound mind and memory, do hereby declare this to be my Last Will and Testament, revoking all previous wills and codicils made by me. ARTICLE I: APPOINTMENT OF EXECUTOR I appoint ${executorName} as the Executor of this will. If ${executorName} is unable or unwilling to serve, I appoint ${altExecutorName} as my alternate Executor. My Executor shall have all powers allowable to executors under the laws of the State of ${testatorState}. ARTICLE II: DEBTS AND EXPENSES I direct my Executor to pay all of my just debts, funeral expenses, and expenses of my last illness from my estate. ARTICLE III: DISPOSITION OF PROPERTY ${residuaryClause} IN WITNESS WHEREOF, I, ${testatorName}, have signed my name below on this ${new Date().toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })}. ________________________________________ ${testatorName} ATTESTATION CLAUSE On the date written above, ${testatorName}, the Testator, declared to us, the undersigned, that this instrument was their Last Will and Testament. The Testator then signed this Will in our presence, and we, at the Testator's request and in their presence and in the presence of each other, have signed our names below as witnesses. ________________________________________ Witness 1 Name: Address: ________________________________________ Witness 2 Name: Address: `.trim(); willPreview.textContent = state.willText; downloadBtn.disabled = false; } function downloadPDF() { if (!state.willText) return; const { jsPDF } = jspdf; const doc = new jspdf.jsPDF({ orientation: 'p', unit: 'pt', format: 'letter' }); doc.setFont('Times-Roman', 'normal'); doc.setFontSize(12); const margin = 72; // 1 inch const pageWidth = doc.internal.pageSize.getWidth(); const usableWidth = pageWidth - (margin * 2); const lines = doc.splitTextToSize(state.willText, usableWidth); doc.text(lines, margin, margin); doc.save(`${document.getElementById('testator-name').value.replace(/ /g, '_')}_Last_Will.pdf`); } // --- EVENT LISTENERS --- addBeneficiaryForm.addEventListener('submit', (e) => { e.preventDefault(); const nameInput = document.getElementById('beneficiary-name'); const relationInput = document.getElementById('beneficiary-relation'); if (nameInput.value && relationInput.value) { state.beneficiaries.push({ name: nameInput.value, relation: relationInput.value }); renderBeneficiaries(); nameInput.value = ''; relationInput.value = ''; } }); if (previewBtn) previewBtn.addEventListener('click', generateWillText); if (downloadBtn) downloadBtn.addEventListener('click', downloadPDF); if (nextBtn) nextBtn.addEventListener('click', () => showTab(state.currentTab + 1)); if (prevBtn) prevBtn.addEventListener('click', () => showTab(state.currentTab - 1)); // --- INITIALIZATION --- function initialize() { if (stateSelect) { states.forEach(s => { const option = document.createElement('option'); option.value = s; option.textContent = s; stateSelect.appendChild(option); }); stateSelect.value = "California"; // Default } renderBeneficiaries(); showTab(0); } initialize(); });
Scroll to Top