🍪
Business & Legal/Cookie Consent Banner Generator

Cookie Consent Banner Generator

GDPR / ePrivacy consent banner with script blocking — production-ready code in 30 seconds.

14 LANGUAGESGDPR + CCPA14 languagesConsent Mode v2Custom color
BANNER CODE
Configure and click "Generate Code"
Data Source & Legal Disclaimer
Effective: Current regulations
Sources: ePrivacy Directive (EU Cookie Law) · GDPR — General Data Protection Regulation

⚠️ This generator creates a cookie consent banner based on your configuration. It is NOT legal advice. Consent requirements vary by jurisdiction. For commercial sites, have a qualified attorney or DPO review your implementation. Generated locally — no data uploaded.

See all data sources & update policy →

How cookie consent actually works — illustrated

Under the EU ePrivacy Directive and GDPR, a site may not drop most cookies until the visitor has actively chosen. The banner must appear before non-essential tags fire, offer a real choice (accept, decline, or fine-grained preferences), and record that choice — GDPR Article 7 requires you to be able to prove consent. Only strictly essentialcookies (session, security, cart) may load without consent. This generator emits a banner that buckets tags into categories, stores the visitor's selection, and lets them reopen preferences later — which is exactly the flow regulators expect from a Consent Mode v2 / CMP setup.

The consent flow
Consent bannerblocks non-essential cookiesAccept allevery categoryDeclineessential onlyPreferencespick categoriesEssentialalways onAnalyticsopt-in onlyMarketingopt-in onlyConsent record savedchoice + timestamp · proof for Art. 7

Banner first, choice second, then and only then do the selected cookie categories load — and the decision is stored as proof.

Henrik's EU Shopify store

Henrik's store serves EU customers and drops three sets of cookies: essential cart/session cookies, Google Analytics, and a Meta pixel. He installs the generated GDPR banner with Decline + Preferences enabled.

  1. Before consent:The ePrivacy Directive requires prior consent — Analytics and the Meta pixel stay blocked until Henrik's visitor makes a choice.
  2. The choice:A visitor clicks "Accept all" and GA + the pixel fire; a visitor who clicks "Decline" gets only the essential cart cookies.
  3. The record:The banner stores the choice and timestamp — that record is the proof GDPR Art. 7 requires if the DPA ever asks.
  4. The revisit:On return visits the banner stays hidden because consent was recorded, but a Preferences link lets the visitor revoke or change categories anytime.
↩ Back to calculator

To create a cookie banner: customize the banner style, message, and cookie categories — the tool generates copy-paste HTML/CSS/JS code for your website.

FreeToolHub Cookie Consent Generator is a free browser-based tool that creates GDPR-compliant cookie consent banners, no signup.

About this tool

What is this tool?

Generate a free GDPR/CCPA cookie consent banner in 30 seconds. Copy & paste HTML, no signup, no code required. Free online tool.

GDPR + CCPA14 languagesConsent Mode v2Custom color

What Is the Cookie Consent Banner Generator?

The Cookie Consent Banner Generator produces copy-paste JavaScript for a working cookie banner in about thirty seconds. You pick a compliance mode — GDPR (strict), where tracking scripts stay blocked until the visitor consents, or ePrivacy (loose), where scripts load but tracking stays limited — and the builder emits a snippet built on the cookieconsent v3 library served from the jsDelivr CDN. Configuration covers fourteen languages from English and German to Arabic, Japanese, and Turkish, a light or dark palette or a custom accent color picked from a color wheel, optional Decline and Preferences buttons, and your privacy policy URL. Alongside the code, a Setup Docs tab explains installation and Google Consent Mode v2 integration.

Who Should Use This Tool?

Indie developers and agencies shipping European-facing sites use it when a client needs a compliant banner this week, not after a procurement cycle. WordPress bloggers who cannot justify a monthly consent-management subscription get the same blocking behavior for free. Store owners migrating to GA4 learn from the warnings system: GDPR mode refuses to hide the Decline button because regulators require an equal reject option, and an empty privacy policy URL triggers a reminder to paste the real link. Marketing teams appreciate the category support — analytics, marketing, preferences, and functional scripts are grouped separately — and anyone targeting multilingual audiences gets native banner text in fourteen languages instead of machine-translated buttons.

How Does It Work?

(1) Configure the banner: choose GDPR or ePrivacy compliance, pick one of fourteen languages, select a light, dark, or custom palette, toggle the Decline and Preferences buttons, and enter your privacy policy URL. (2) Click Generate Code to receive the snippet — a script tag loading cookieconsent v3, the stylesheet, and an init block containing your full configuration with translated message and button labels. (3) Paste it into your site head, above any tracking scripts, then wrap each tracker with a category attribute so consent gates firing. (4) Switch to the Setup tab for step-by-step docs, category breakdowns, and the four Google Consent Mode v2 signals to wire into Tag Manager. Copy either output with one click.

How Do I Block Tracking Scripts Until Consent?

The generated setup docs show the pattern: convert each tracking script to a plain-text script tag and tag it with a data-cookie-consent attribute matching its category — analytics, marketing, preferences, or functional. A Google Analytics snippet becomes type text/plain with data-cookie-consent analytics, so the browser downloads nothing until a visitor accepts. GDPR mode blocks by default and waits for explicit consent; ePrivacy mode loads scripts but limits tracking until the banner is answered. For Google stacks, the docs list the four Consent Mode v2 signals — analytics_storage, ad_storage, ad_user_data, and ad_personalization — which you fire as granted or denied on every consent change, keeping GA4 and ads compliant with EU requirements.

Frequently Asked Questions

Do I need a cookie consent banner on my website?

You need one if you serve EU/UK visitors and use non-essential cookies or trackers. GDPR and the ePrivacy Directive require prior opt-in consent. US-only sites without California or Colorado traffic obligations face lighter requirements.

What is Google Consent Mode v2?

Consent Mode v2 sends two new signals, ad_user_data and ad_personalization, to Google when users accept or reject cookies. Google Ads and Analytics require v2 for EEA traffic measurement as of March 2024.

Is a cookie banner required in the US?

There is no federal cookie-banner law, but California CCPA/CPRA requires a do-not-sell-or-share link for applicable sites, and several states now regulate opt-out preference signals like Global Privacy Control.

Can I generate a GDPR-compliant cookie banner for free?

Yes. This generator produces a production-ready banner with granular category toggles, Consent Mode v2 integration, and customizable styling in about 30 seconds — no account or payment required.

Does the generated banner satisfy GDPR and CCPA requirements?

Yes. The banner includes GDPR-required elements: explicit consent before non-essential cookies, a reject-all button equal in prominence to accept, and a link to cookie categories. For CCPA, it adds a "Do Not Sell My Personal Information" opt-out. The code is copy-paste ready and deploys in under 30 seconds.

What happens if my site lacks a compliant cookie banner?

GDPR fines reach €20 million or 4% of global annual revenue (whichever is higher). In 2023, Meta was fined €1.2 billion for data transfer violations. CCPA penalties run $2,500 per violation or $7,500 for intentional violations. A compliant banner is the lowest-cost defense against regulatory enforcement.

Related tools

Joke of the Day
Sep 6

What do you call a crab that plays baseball?

100% Free, Forever

Keep Tools Free for Everyone

No paywalls, no signups, no data sold. Built by a solo developer who believes useful tools should be accessible to everyone.

Support me on Ko-fi— keep tools free

100% of proceeds go towards hosting & building more free tools.