Friday, June 5, 2026

Sitemap XML Generator Tool – Free Online XML Sitemap Creator for Google | Sachhita SVE Tools

Advertisement

Header Advertisement Area 728x90

Free Sitemap XML Generator Tool

Create SEO-friendly XML sitemaps instantly for Blogger, WordPress, eCommerce stores and business websites.

Visit Sachhita SVE Tools
Sitemap XML Generator Tool

Generate XML Sitemap

Generated Sitemap XML

Sponsored Content

Responsive Sidebar Ad Area

Why Use a Sitemap XML Generator?

A sitemap.xml file helps search engines understand your website structure and discover important pages faster. Whether you operate a Blogger website, WordPress blog, online store, portfolio or business website, an XML sitemap improves crawl efficiency and indexing.

Benefits of XML Sitemaps

  • Faster Google indexing
  • Better crawl coverage
  • Improved SEO visibility
  • Easy discovery of new pages
  • Supports large websites
  • Useful for Blogger and WordPress users

Our free Sitemap XML Generator makes sitemap creation simple. Enter your website pages, generate the XML file, and upload it to your website root directory before submitting it to Google Search Console.

/* ========================= RESET ========================= */ *{ margin:0; padding:0; box-sizing:border-box; } html{ scroll-behavior:smooth; } body{ font-family:Segoe UI,Arial,sans-serif; background:#f5f7fb; color:#222; line-height:1.7; transition:.3s ease; } /* ========================= DARK MODE ========================= */ body.dark-mode{ background:#121212; color:#f1f1f1; } body.dark-mode .tool-card, body.dark-mode .article-section, body.dark-mode .ad-box, body.dark-mode textarea, body.dark-mode input{ background:#1e1e1e; color:#fff; border-color:#333; } body.dark-mode footer{ background:#0d0d0d; } body.dark-mode .hero{ background:linear-gradient(135deg,#0d47a1,#1a237e); } /* ========================= THEME BUTTON ========================= */ .theme-btn{ position:fixed; top:20px; right:20px; z-index:999; border:none; cursor:pointer; padding:12px 18px; border-radius:50px; font-size:14px; font-weight:600; background:#1e88e5; color:#fff; box-shadow:0 4px 15px rgba(0,0,0,.2); } .theme-btn:hover{ transform:translateY(-2px); } /* ========================= HERO SECTION ========================= */ .hero{ display:flex; align-items:center; justify-content:space-between; gap:40px; padding:70px 5%; background:linear-gradient(135deg,#1976d2,#42a5f5); color:#fff; } .hero-content{ flex:1; } .hero-content h1{ font-size:48px; font-weight:800; margin-bottom:20px; line-height:1.2; } .hero-content p{ font-size:18px; margin-bottom:25px; } .hero-image{ flex:1; text-align:center; } .hero-image img{ max-width:100%; border-radius:20px; box-shadow:0 15px 40px rgba(0,0,0,.25); } .home-btn{ display:inline-block; padding:14px 25px; background:#fff; color:#1565c0; font-weight:700; border-radius:10px; text-decoration:none; transition:.3s; } .home-btn:hover{ transform:translateY(-3px); } /* ========================= MAIN ========================= */ main{ max-width:1200px; margin:auto; padding:40px 20px; } section{ margin-bottom:40px; } h2{ font-size:32px; margin-bottom:20px; color:#1565c0; } h3{ margin-bottom:12px; } /* ========================= TOOL CARD ========================= */ .tool-card{ background:#fff; padding:30px; border-radius:18px; box-shadow:0 10px 30px rgba(0,0,0,.08); } .tool-card label{ display:block; margin-bottom:8px; font-weight:700; } input, textarea{ width:100%; padding:14px; border:1px solid #d6d6d6; border-radius:10px; margin-bottom:18px; font-size:15px; outline:none; transition:.3s; } input:focus, textarea:focus{ border-color:#2196f3; box-shadow:0 0 0 3px rgba(33,150,243,.15); } /* ========================= BUTTONS ========================= */ .button-group{ display:flex; flex-wrap:wrap; gap:15px; } .button-group button{ border:none; cursor:pointer; padding:14px 22px; border-radius:10px; font-size:15px; font-weight:700; transition:.3s; } #generateBtn{ background:#1976d2; color:#fff; } #copyBtn{ background:#2e7d32; color:#fff; } #downloadBtn{ background:#ef6c00; color:#fff; } .button-group button:hover{ transform:translateY(-3px); opacity:.95; } /* ========================= RESULT AREA ========================= */ #result{ background:#fafafa; font-family:Consolas,monospace; min-height:350px; } /* ========================= AD SECTION ========================= */ .ad-container{ margin:30px 0; text-align:center; } .ad-container h3{ margin-bottom:15px; } .ad-box{ background:#fff; border:2px dashed #bdbdbd; padding:35px; border-radius:15px; font-size:18px; font-weight:600; box-shadow:0 5px 15px rgba(0,0,0,.06); } /* ========================= SHARE BUTTONS ========================= */ .share-buttons{ display:flex; flex-wrap:wrap; gap:15px; } .share-buttons button{ padding:14px 20px; border:none; cursor:pointer; border-radius:10px; font-weight:700; transition:.3s; } .share-buttons button:hover{ transform:translateY(-3px); } #facebookShare{ background:#1877f2; color:#fff; } #twitterShare{ background:#000; color:#fff; } #linkedinShare{ background:#0a66c2; color:#fff; } #whatsappShare{ background:#25d366; color:#fff; } /* ========================= ARTICLE ========================= */ .article-section{ background:#fff; padding:35px; border-radius:18px; box-shadow:0 10px 30px rgba(0,0,0,.08); } .article-section p{ margin-bottom:18px; } .article-section ul{ padding-left:25px; margin-bottom:20px; } .article-section li{ margin-bottom:10px; } /* ========================= FOOTER ========================= */ footer{ background:#1565c0; color:#fff; padding:50px 20px; margin-top:50px; } .footer-content{ max-width:1200px; margin:auto; text-align:center; } .footer-content h2{ color:#fff; margin-bottom:15px; } .footer-content a{ color:#fff; font-weight:700; text-decoration:none; } /* ========================= SCROLLBAR ========================= */ ::-webkit-scrollbar{ width:10px; } ::-webkit-scrollbar-track{ background:#eee; } ::-webkit-scrollbar-thumb{ background:#1976d2; border-radius:20px; } /* ========================= RESPONSIVE ========================= */ @media(max-width:992px){ .hero{ flex-direction:column; text-align:center; } .hero-content h1{ font-size:38px; } } @media(max-width:768px){ .theme-btn{ top:10px; right:10px; font-size:13px; padding:10px 15px; } .hero{ padding:50px 20px; } .hero-content h1{ font-size:30px; } .hero-content p{ font-size:16px; } h2{ font-size:26px; } .tool-card{ padding:20px; } .article-section{ padding:25px; } .button-group{ flex-direction:column; } .button-group button{ width:100%; } .share-buttons{ flex-direction:column; } .share-buttons button{ width:100%; } } @media(max-width:480px){ .hero-content h1{ font-size:26px; } h2{ font-size:22px; } .ad-box{ padding:25px; font-size:15px; } } /* ========================================== SITEMAP XML GENERATOR ========================================== */ const websiteUrl = document.getElementById("websiteUrl"); const urlList = document.getElementById("urlList"); const result = document.getElementById("result"); const generateBtn = document.getElementById("generateBtn"); const copyBtn = document.getElementById("copyBtn"); const downloadBtn = document.getElementById("downloadBtn"); /* ========================================== GENERATE XML SITEMAP ========================================== */ generateBtn.addEventListener("click", () => { let urls = urlList.value .split("\n") .map(url => url.trim()) .filter(url => url !== ""); if(urls.length === 0){ if(websiteUrl.value.trim() !== ""){ urls.push(websiteUrl.value.trim()); }else{ alert("Please enter at least one URL."); return; } } let sitemap = ` `; urls.forEach(url => { sitemap += ` ${escapeXml(url)} ${getCurrentDate()} weekly 0.8 `; }); sitemap += ` `; result.value = sitemap; }); /* ========================================== XML ESCAPE FUNCTION ========================================== */ function escapeXml(text){ return text .replace(/&/g, "&") .replace(//g, ">") .replace(/"/g, """) .replace(/'/g, "'"); } /* ========================================== CURRENT DATE ========================================== */ function getCurrentDate(){ const today = new Date(); return today.toISOString().split("T")[0]; } /* ========================================== COPY XML ========================================== */ copyBtn.addEventListener("click", () => { if(result.value.trim() === ""){ alert("Generate sitemap first."); return; } navigator.clipboard.writeText(result.value) .then(() => { copyBtn.innerHTML = "Copied Successfully ✓"; setTimeout(() => { copyBtn.innerHTML = "Copy XML"; }, 2500); }) .catch(() => { alert("Copy failed. Please copy manually."); }); }); /* ========================================== DOWNLOAD XML FILE ========================================== */ downloadBtn.addEventListener("click", () => { if(result.value.trim() === ""){ alert("Generate sitemap first."); return; } const blob = new Blob( [result.value], { type: "application/xml" } ); const link = document.createElement("a"); link.href = URL.createObjectURL(blob); link.download = "sitemap.xml"; document.body.appendChild(link); link.click(); document.body.removeChild(link); }); /* ========================================== DARK MODE TOGGLE ========================================== */ const themeToggle = document.getElementById("themeToggle"); const savedTheme = localStorage.getItem("theme"); if(savedTheme === "dark"){ document.body.classList.add("dark-mode"); themeToggle.innerHTML = "☀️ Light Mode"; } themeToggle.addEventListener("click", () => { document.body.classList.toggle("dark-mode"); if( document.body.classList.contains("dark-mode") ){ localStorage.setItem("theme","dark"); themeToggle.innerHTML = "☀️ Light Mode"; }else{ localStorage.setItem("theme","light"); themeToggle.innerHTML = "🌙 Dark Mode"; } }); /* ========================================== SOCIAL SHARE ========================================== */ const shareUrl = encodeURIComponent( "https://www.sachhitasveertools.com/" ); const shareTitle = encodeURIComponent( "Free Sitemap XML Generator Tool" ); document .getElementById("facebookShare") .addEventListener("click", () => { window.open( `https://www.facebook.com/sharer/sharer.php?u=${shareUrl}`, "_blank" ); }); document .getElementById("twitterShare") .addEventListener("click", () => { window.open( `https://twitter.com/intent/tweet?url=${shareUrl}&text=${shareTitle}`, "_blank" ); }); document .getElementById("linkedinShare") .addEventListener("click", () => { window.open( `https://www.linkedin.com/sharing/share-offsite/?url=${shareUrl}`, "_blank" ); }); document .getElementById("whatsappShare") .addEventListener("click", () => { window.open( `https://wa.me/?text=${shareTitle}%20${shareUrl}`, "_blank" ); }); /* ========================================== AUTO SAMPLE URLS ========================================== */ window.addEventListener("load", () => { if(urlList.value.trim() === ""){ urlList.value = `https://example.com/ https://example.com/about https://example.com/contact https://example.com/blog`; } }); /* ========================================== KEYBOARD SHORTCUTS ========================================== */ document.addEventListener("keydown", (e) => { if(e.ctrlKey && e.key === "Enter"){ generateBtn.click(); } }); /* ========================================== SHARE GENERATED XML ========================================== */ function shareGeneratedXML(){ if(result.value.trim() === ""){ alert("Generate sitemap first."); return; } if(navigator.share){ navigator.share({ title:"Generated Sitemap XML", text:"Generated using Sitemap XML Generator", url:"https://www.sachhitasveertools.com/" }); }else{ alert( "Web Share API not supported on this device." ); } } /* ========================================== CHARACTER COUNT ========================================== */ urlList.addEventListener("input", () => { const lines = urlList.value .split("\n") .filter(item => item.trim() !== "") .length; document.title = `(${lines}) Sitemap XML Generator`; }); /* ========================================== URL VALIDATION ========================================== */ function isValidURL(url){ try{ new URL(url); return true; }catch{ return false; } } urlList.addEventListener("blur", () => { let urls = urlList.value .split("\n") .map(url => url.trim()); let invalid = []; urls.forEach(url => { if(url !== "" && !isValidURL(url)){ invalid.push(url); } }); if(invalid.length > 0){ alert( "Invalid URL(s):\n\n" + invalid.join("\n") ); } }); /* ========================================== TOOL READY ========================================== */ console.log( "Sitemap XML Generator Loaded Successfully" );

No comments:

Post a Comment

Sitemap XML Generator Tool – Free Online XML Sitemap Creator for Google | Sachhita SVE Tools ...