100% FreeSecure & LocalNo Sign-up

Cookie Consent Banner Generator

Generate a customizable cookie consent banner with ready-to-paste HTML/JS code.

Advertisement728 x 90
Show Decline button
Show Learn More link

Live Preview

We use cookies to enhance your browsing experience and analyze site traffic. By clicking 'Accept', you consent to our use of cookies.Learn More

<!-- Cookie Consent Banner by Swiftly.tools -->
<div id="swiftly-cookie-banner" style="position:fixed;bottom:0;left:0;right:0;z-index:99999;background:#1E293B;color:#F1F5F9;padding:16px 24px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;font-size:14px;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;box-shadow:0 -4px 20px rgba(0,0,0,0.15);">
  <p style="margin:0;flex:1;min-width:200px;line-height:1.5;">
    We use cookies to enhance your browsing experience and analyze site traffic. By clicking 'Accept', you consent to our use of cookies. <a href="/privacy" style="color:#3B82F6;text-decoration:underline;font-weight:600;">Learn More</a>
  </p>
  <div style="display:flex;gap:8px;flex-shrink:0;">
    <button onclick="document.getElementById('swiftly-cookie-banner').style.display='none';localStorage.setItem('cookie-consent','declined')" style="background:transparent;color:#F1F5F9;border:1px solid #F1F5F940;padding:8px 20px;border-radius:8px;cursor:pointer;font-size:14px;font-weight:600;">Decline</button>
    <button onclick="document.getElementById('swiftly-cookie-banner').style.display='none';localStorage.setItem('cookie-consent','accepted')" style="background:#3B82F6;color:#FFFFFF;border:none;padding:8px 20px;border-radius:8px;cursor:pointer;font-size:14px;font-weight:600;">Accept</button>
  </div>
</div>
<script>
  if(localStorage.getItem('cookie-consent')){document.getElementById('swiftly-cookie-banner').style.display='none';}
</script>

Paste this code before the closing </body> tag of your HTML.

How to use Cookie Consent Banner Generator

  1. 1

    Customize your banner

    Edit the message, button text, colors, and position to match your brand.

  2. 2

    Preview the result

    See a live preview of how the banner will look on your site.

  3. 3

    Copy the code

    Copy the generated HTML/JS snippet and paste it before the closing </body> tag of your website.

About Cookie Consent Banner Generator

Create a GDPR-compliant cookie consent banner for your website. Customize colors, position, button text, and behavior. Get clean, ready-to-paste HTML and JavaScript code — no dependencies required.

Frequently Asked Questions

This banner provides users the ability to accept or decline cookies, which is a core GDPR requirement. For full compliance, ensure your privacy policy details your cookie usage.

Other Free Utilities

Advertisement320 x 50