Word Count & Readability Checker

Word Count & Readability Checker

Paste your text below for a real-time analysis.

Your Text

Word Count

0

Characters

0

Reading Time

~0 min

Readability Level (Flesch-Kincaid)

N/A

Keyword Density

Keywords will appear here as you type.

Keywords will appear here as you type.

`; } } async function generatePdf() { document.getElementById('pdf-date').textContent = new Date().toLocaleDateString(); document.getElementById('pdf-kpis').innerHTML = `

Word Count

${lastAnalysis.wordCount}

Characters

${lastAnalysis.charCount}

Reading Time

~${lastAnalysis.readingTime} min

`; document.getElementById('pdf-readability').innerHTML = `

Readability Grade

${lastAnalysis.gradeLevel}

`; const tableClone = document.querySelector('#keyword-table-container table')?.cloneNode(true); if (tableClone) { tableClone.classList.add("w-full", "text-xs"); document.getElementById('pdf-table-container').innerHTML = ''; document.getElementById('pdf-table-container').appendChild(tableClone); } else { document.getElementById('pdf-table-container').innerHTML = 'No keyword data available.'; } const reportEl = document.getElementById('pdf-report'); reportEl.classList.remove('hidden'); const canvas = await html2canvas(reportEl, { scale: 2 }); reportEl.classList.add('hidden'); const imgData = canvas.toDataURL('image/png'); const { jsPDF } = window.jspdf; const pdf = new jsPDF({ orientation: 'p', unit: 'in', format: 'letter' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = (canvas.height * pdfWidth) / canvas.width; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight); pdf.save('Text-Analysis-Report.pdf'); } textInput.addEventListener('input', analyzeText); document.getElementById('downloadPdfBtn').addEventListener('click', generatePdf); });
Scroll to Top