Free · No signup · 100% client-side

Cookie Consent Banner Generator

Build a clean, working cookie banner for your website in under a minute. Pick your style, get a single copy-paste snippet that remembers the visitor's choice and exposes a simple window.cookieConsent flag so you can gate your analytics and marketing tags. No backend, no account, nothing leaves your browser.

1 · Customize

Shown in the banner heading, e.g. “Acme Co. uses cookies”.

Used for the Accept button + accents.

Background of the banner itself.

“Reject” and “Customize” are recommended for GDPR-style consent.

Cookie categories to mention

Optional. Adds a “Privacy policy” link in the banner. Need one? Generate it free ↗

2 · Live preview

The preview above is the real generated banner. Click its buttons to test it.

3 · Copy your snippet

Paste this once, just before </body> on every page of your site. It is fully self-contained — no libraries, no build step.

Disclaimer: This is a customizable banner template to help you get started — not legal advice. Cookie/consent rules (GDPR, ePrivacy, CCPA/CPRA, and others) depend on where your visitors are, what data you collect, and how your site works. Consult a qualified professional for compliance needs.

How to use the snippet

  1. Paste it before </body>

    Copy the generated snippet and paste it once near the end of your page, before the closing </body> tag. On Webflow, Squarespace, WordPress, Shopify or a plain HTML site, use the “custom code / footer” area.

  2. Gate your tracking scripts

    The snippet sets a global window.cookieConsent = { analytics: boolean, marketing: boolean } and fires a cookieconsent:change event. Wrap your Google Analytics / Meta Pixel / ad tags so they only load when the matching flag is true — the generated code shows you exactly where.

  3. It remembers the choice

    The visitor's decision is saved in localStorage, so the banner won't nag them on every page load. They can re-open preferences anytime by calling window.cookieConsent.open() (wire it to a “Cookie settings” footer link).