π₯Pill Identifier
Identify unknown pills, tablets, and capsules instantly using imprint codes, colors, shapes, and sizes. Our free FDA-approved medication identifier helps you stay safe and informed.
Important Medical Disclaimer
This tool is for informational purposes only and should not replace professional medical advice.
Always consult with your healthcare provider or pharmacist before taking any unknown medication.
Never take pills that have not been prescribed to you.
π€ What Is a Pill Identifier?
Think of a detective for mystery medications - that's a pill identifier! It matches pills by their imprint codes, colors, and shapes to tell you exactly what medication you're looking at. Perfect for organizing medicine cabinets or identifying unmarked pills safely.
π§ͺ Try Common Pill Examples
π Tylenol (L484)
White, Oval, Acetaminophen 500mg
π Ibuprofen (I2)
Brown, Round, 200mg
π Aspirin (44175)
White, Round, 325mg
π Benadryl (44329)
Pink, Capsule, 25mg
π Lisinopril (3973 V)
Pink, Round, 10mg
π Metformin (IP 178)
White, Oval, 500mg
${content.replace(/\n/g, '
')}`; } chatMessages.appendChild(messageDiv); chatMessages.scrollTop = chatMessages.scrollHeight; } // Geminiμ λ©μμ§ μ μ‘ 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 a Pill Identifier tool on WIA Pin Code platform. This tool helps identify medications by imprint code, color, shape, and size. User question: ${message} IMPORTANT: Always remind user that this is educational information only and they should: 1. Never take unidentified pills 2. Consult healthcare providers for medical advice 3. Contact poison control if emergency 4. Take unknown pills to pharmacist for professional identification` }] }], 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() { const imprintInput = document.getElementById('imprintCode'); // μν° ν€ μ²λ¦¬ imprintInput.addEventListener('keypress', function(e) { if (e.key === 'Enter') { identifyPill(); } }); // μ λ ₯μ μλ¬ ν΄λ¦¬μ΄ imprintInput.addEventListener('input', clearErrors); // μνλ¦°νΈ μ½λ μλ λλ¬Έμ λ³ν imprintInput.addEventListener('input', function(e) { e.target.value = e.target.value.toUpperCase(); }); // AI λ²νΌ μ΄λ²€νΈ document.getElementById('aiBtn').addEventListener('click', openAIModal); // λͺ¨λ¬ μΈλΆ ν΄λ¦μ λ«κΈ° document.getElementById('aiModal').addEventListener('click', function(e) { if (e.target === this) { closeAIModal(); } }); // ν€λ³΄λ μ΄λ²€νΈ document.addEventListener('keydown', function(e) { if (e.key === 'Enter') { const geminiInput = document.getElementById('geminiInput'); if (document.activeElement === geminiInput) { sendToGemini(); } } if (e.key === 'Escape') { closeAIModal(); } }); updateAPIKeyStatus(); updateCurrentYear(); updateToolCount(); }); // ========== 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 211 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 211 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 });