Strip HTML Tags Online

Remove HTML tags and formatting from any text instantly. Perfect for content writers, developers, and data processing. Free online HTML stripper with AI assistance.

βš™οΈ Stripping Options

HTML Elements
Content Cleaning
Keep Specific Tags (Whitelist)
Enter tags to preserve (comma-separated). Leave empty to remove all tags.
πŸ“„ HTML Input 0 chars
πŸ“ Clean Text Output 0 chars

πŸ“‹ Try Sample HTML

πŸ“° Basic HTML
Simple HTML with tags and attributes
πŸ“ Blog Post
Article with formatting and links
πŸ“§ Email Template
HTML email with styles
πŸ“‹ Web Form
Contact form with inputs
πŸ—‘οΈ Messy HTML
Complex HTML with scripts and styles
πŸ“„ CMS Content
WordPress/CMS generated HTML

✨ Smart Nation's Core Infrastructure: WIA Code ✨

DroneΒ·Robot delivery, autonomous driving, emergency rescue and more - Experience the future in 30 days, completely free for your nation!

Learn More About WIA Code

πŸ€– Choose Your AI Assistant

πŸ’¬ ChatGPT
Most versatile β€’ Best for general tasks
🧠 Claude
Best reasoning β€’ Perfect for analysis
✨ Gemini FREE
Free daily limits β€’ Built-in chat
`, 'form': `
Contact Information
`, 'messy': `

Welcome

This is messy HTML with lots of unnecessary code.

`, 'cms': `

Our Services

Service 1

Web Design

We create beautiful, responsive websites.

Service 2

SEO Optimization

Improve your search engine rankings.

` }; document.getElementById('inputHtml').value = samples[sampleId]; updateCharCounts(); // Smooth scroll to action button document.getElementById('stripButton').scrollIntoView({ behavior: 'smooth', block: 'center' }); // Highlight button const btn = document.getElementById('stripButton'); btn.style.animation = 'pulse 0.5s ease-in-out'; setTimeout(() => btn.style.animation = '', 500); } // UTILITY FUNCTIONS // Copy to clipboard function copyToClipboard(text) { navigator.clipboard.writeText(text).then(() => { showNotification('Copied to clipboard!', 'success'); }).catch(() => { // Fallback for older browsers const textArea = document.createElement('textarea'); textArea.value = text; document.body.appendChild(textArea); textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); showNotification('Copied to clipboard!', 'success'); }); } // Show notification toast function showNotification(message, type = 'success') { const toast = document.createElement('div'); toast.className = `toast ${type}`; toast.textContent = message; document.body.appendChild(toast); setTimeout(() => { toast.remove(); }, 3000); } // Show OTA section function showOTA() { // Developer tools don't show travel OTA return; } // Analytics tracking function trackEvent(eventName, data = {}) { if (typeof gtag !== 'undefined') { gtag('event', eventName, { 'event_category': TOOL_CONFIG.category, 'event_label': TOOL_CONFIG.name, ...data }); } } // AI ASSISTANT FUNCTIONS function openAIModal() { const modal = document.getElementById('aiModal'); modal.classList.add('show'); if (aiModalState.apiKey && aiModalState.currentView === 'gemini') { showGeminiChat(); } else { showAISelector(); } updateAPIKeyStatus(); } function closeAIModal() { const modal = document.getElementById('aiModal'); modal.classList.remove('show'); setTimeout(() => { aiModalState.currentView = 'selector'; showAISelector(); }, 300); } function showAISelector() { document.getElementById('aiModalTitle').textContent = 'Choose Your AI Assistant'; document.getElementById('aiSelector').style.display = 'flex'; document.getElementById('geminiChat').style.display = 'none'; document.getElementById('apiKeySetup').style.display = 'none'; aiModalState.currentView = 'selector'; } function showGeminiChat() { document.getElementById('aiModalTitle').innerHTML = '✨ Gemini AI Assistant'; document.getElementById('aiSelector').style.display = 'none'; document.getElementById('geminiChat').style.display = 'flex'; document.getElementById('apiKeySetup').style.display = 'none'; aiModalState.currentView = 'gemini'; const chatMessages = document.getElementById('chatMessages'); if (!chatMessages.innerHTML.trim()) { addMessage('assistant', `Hello! I can help you with: β€’ How to use the HTML Tag Stripper β€’ Best practices for cleaning HTML content β€’ Different stripping options and when to use them β€’ Security considerations when processing HTML β€’ WIA Code system questions What would you like to know?`); } } function showAPIKeySetup() { document.getElementById('aiModalTitle').textContent = 'Setup Gemini API'; document.getElementById('aiSelector').style.display = 'none'; document.getElementById('geminiChat').style.display = 'none'; document.getElementById('apiKeySetup').style.display = 'block'; aiModalState.currentView = 'setup'; } function selectAI(aiType) { switch(aiType) { case 'chatgpt': const toolContext = `I need help with the HTML Tag Stripper on WIA Code platform. This tool removes HTML tags and formatting from text for content processing and security.`; const chatUrl = `https://chat.openai.com/?q=${encodeURIComponent(toolContext)}`; window.open(chatUrl, '_blank'); closeAIModal(); trackEvent('ai_selection', { ai_type: 'chatgpt' }); break; case 'claude': const claudeContext = `I need help with the HTML Tag Stripper on WIA Code platform. This tool removes HTML tags and formatting from text for content processing and security.`; const claudeUrl = `https://claude.ai/chat?q=${encodeURIComponent(claudeContext)}`; window.open(claudeUrl, '_blank'); closeAIModal(); trackEvent('ai_selection', { ai_type: 'claude' }); break; case 'gemini': if (!aiModalState.apiKey) { showAPIKeySetup(); } else { showGeminiChat(); } trackEvent('ai_selection', { ai_type: 'gemini' }); break; } } function saveGeminiApiKey() { const apiKey = document.getElementById('geminiApiKeyInput').value.trim(); if (apiKey) { localStorage.setItem('geminiApiKey', apiKey); aiModalState.apiKey = apiKey; showGeminiChat(); updateAPIKeyStatus(); } else { alert('Please enter a valid API key'); } } function updateAPIKeyStatus() { const statusEl = document.getElementById('apiKeyStatus'); if (aiModalState.apiKey) { statusEl.innerHTML = 'Change API Key'; } else { statusEl.textContent = 'No API key set'; } } function addMessage(type, content) { const chatMessages = document.getElementById('chatMessages'); const messageDiv = document.createElement('div'); messageDiv.className = `message ${type}`; if (type === 'user') { messageDiv.innerHTML = `You: ${content}`; } else { messageDiv.innerHTML = `✨ Gemini:
${content.replace(/\n/g, '
')}`; } chatMessages.appendChild(messageDiv); chatMessages.scrollTop = chatMessages.scrollHeight; } async function sendToGemini() { const input = document.getElementById('geminiInput'); const message = input.value.trim(); if (!message) return; addMessage('user', message); input.value = ''; const loadingMsg = document.createElement('div'); loadingMsg.className = 'message assistant'; loadingMsg.innerHTML = '✨ Gemini:
Thinking...'; loadingMsg.id = 'loading-message'; document.getElementById('chatMessages').appendChild(loadingMsg); try { const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent?key=${aiModalState.apiKey}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ contents: [{ parts: [{ text: `Context: User is using the HTML Tag Stripper on WIA Code platform. This tool removes HTML tags and formatting from text for content processing, security, and data extraction. Features: Customizable stripping options, whitelist support, attribute removal. WIA Code is a universal address system for countries without postal codes. User question: ${message}` }] }], generationConfig: { temperature: 0.7, maxOutputTokens: 1000 } }) }); const data = await response.json(); document.getElementById('loading-message').remove(); if (data.candidates && data.candidates[0] && data.candidates[0].content) { const reply = data.candidates[0].content.parts[0].text; addMessage('assistant', reply); } else { addMessage('assistant', 'Sorry, I could not generate a response. Please try again.'); } } catch (error) { document.getElementById('loading-message')?.remove(); if (error.message.includes('API key')) { addMessage('error', 'Invalid API key. Please check your API key and try again.'); showAPIKeySetup(); } else { addMessage('error', 'Failed to connect to Gemini. Please check your internet connection and try again.'); } } } // EVENT LISTENERS document.addEventListener('DOMContentLoaded', function() { // Update character counts on input const inputHtml = document.getElementById('inputHtml'); const outputText = document.getElementById('outputText'); inputHtml.addEventListener('input', updateCharCounts); outputText.addEventListener('input', updateCharCounts); // Enter key support for AI chat document.getElementById('geminiInput').addEventListener('keypress', function(e) { if (e.key === 'Enter') { sendToGemini(); } }); // AI button event document.getElementById('aiBtn').addEventListener('click', openAIModal); // Modal outside click to close document.getElementById('aiModal').addEventListener('click', function(e) { if (e.target === this) { closeAIModal(); } }); // ESC key to close modal document.addEventListener('keydown', function(e) { if (e.key === 'Escape') { closeAIModal(); } }); updateAPIKeyStatus(); updateCurrentYear(); updateToolCount(); updateCharCounts(); }); // DYNAMIC TOOL COUNT async function updateToolCount() { try { const response = await fetch('/api/tool-count.php'); const data = await response.json(); document.querySelectorAll('.dynamic-tools-count').forEach(el => { el.textContent = `${data.count}+ free online tools in 206 languages. No signup, no fees, just tools that work.`; }); document.querySelectorAll('.dynamic-count').forEach(el => { const prefix = el.getAttribute('data-text') || ''; const suffix = el.getAttribute('data-suffix') || ''; const icon = el.textContent.split(' ')[0] || ''; el.textContent = `${icon} ${prefix} ${data.count}+ ${suffix}`; }); } catch (error) { const fallbackCount = 333; document.querySelectorAll('.dynamic-tools-count').forEach(el => { el.textContent = `${fallbackCount}+ free online tools in 206 languages. No signup, no fees, just tools that work.`; }); document.querySelectorAll('.dynamic-count').forEach(el => { const prefix = el.getAttribute('data-text') || ''; const suffix = el.getAttribute('data-suffix') || ''; const icon = el.textContent.split(' ')[0] || ''; el.textContent = `${icon} ${prefix} ${fallbackCount}+ ${suffix}`; }); } } function updateCurrentYear() { const currentYear = new Date().getFullYear(); document.querySelectorAll('.current-year').forEach(el => { el.textContent = currentYear; }); } // ANALYTICS window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XXXXXXXXX'); trackEvent('page_view', { tool: TOOL_CONFIG.name, category: TOOL_CONFIG.category });