PDF to Word Converter
PDF to Word Converter
Convert your PDF files to Word documents easily – No API key required
Your PDF has been successfully converted!
You can now download your document or preview the content.
Features
🔒
Privacy First
All processing happens in your browser. Your files never leave your computer.
📝
Text Extraction
Extracts text content from your PDF documents with basic formatting.
⚡
Fast Conversion
Quick and efficient conversion process with real-time progress tracking.
💯
Free to Use
No registration, no API keys, completely free conversion tool.
`;return html;
}// Show preview of extracted text
function showPreview() {
previewContent.innerHTML = '';extractedText.forEach((page, pageIndex) => {
const pageDiv = document.createElement('div');
pageDiv.className = 'preview-page';const pageHeader = document.createElement('div');
pageHeader.className = 'preview-page-header';
pageHeader.textContent = `Page ${pageIndex + 1}`;
pageDiv.appendChild(pageHeader);page.forEach(line => {
if (!line.text) return;const lineDiv = document.createElement('div');
lineDiv.textContent = line.text;if (line.fontSize > 14 || line.bold) {
lineDiv.style.fontWeight = 'bold';
}if (line.fontSize > 18) {
lineDiv.style.fontSize = '1.5em';
} else if (line.fontSize > 14) {
lineDiv.style.fontSize = '1.2em';
}pageDiv.appendChild(lineDiv);
});previewContent.appendChild(pageDiv);
});previewContainer.classList.add('show');
}// Update progress bar
function updateProgress(percentage, status) {
progressBar.style.width = percentage + '%';
progressStatus.textContent = status;
progressPercentage.textContent = percentage + '%';
}// Show status message
function showStatus(type, message) {
statusMessage.className = 'status-message show ' + type;
statusMessage.textContent = message;
}// Hide status message
function hideStatus() {
statusMessage.className = 'status-message';
}// Reset UI
function resetUI() {
pdfFile = null;
extractedText = [];
docxBlob = null;fileInfo.classList.remove('show');
progressContainer.classList.remove('show');
downloadSection.classList.remove('show');
previewContainer.classList.remove('show');
hideStatus();
convertBtn.disabled = true;
fileInput.value = '';
}// Format file size
function formatFileSize(bytes) {
if (bytes === 0) return '0 Bytes';const k = 1024;
const sizes = ['Bytes', 'KB', 'MB', 'GB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
}