Cookie Policy Generator

Create a complete cookie policy for your website and a matching cookie consent banner in one place. Choose the cookie categories you use (preferences, Google Analytics, Google AdSense, embedded YouTube videos) and add your own cookies, and the generator builds clear tables with each cookie's name, provider, purpose and duration. It also writes a lightweight, self-contained banner with Accept, Reject and Customise buttons that supports Google Consent Mode v2. Preview it live, then copy the code. It's free, and nothing is uploaded.

  • 100% free
  • No sign-up
  • Private & local
  • Works on mobile

Your website

Cookies you use

Consent banner

Consent banner code

Paste this at the very top of your <head>, before Google Analytics or other tags. It sets Consent Mode v2 defaults to "denied" and updates them when the visitor chooses.

Private by design: every calculation runs locally in your browser. Nothing you type is sent to a server or stored by us.

How to Create a Cookie Policy and Banner

  1. Enter your website details and the date the policy takes effect.
  2. Tick the cookies you use. The generator adds the standard cookies for Google Analytics 4, AdSense and YouTube, with provider, purpose and duration.
  3. Add any other cookies, one per line, in the format name | provider | purpose | duration | category.
  4. Customise the banner: position, colour, text and a link to your cookie policy. Click Live preview to try it.
  5. Publish the policy as a page such as /cookie-policy.html, paste the banner code into the <head> of every page, and add a "Cookie settings" link to your footer.

What Is a Cookie Policy?

A cookie policy is a page that tells visitors which cookies and similar technologies your website uses, who sets them, what they're for and how long they last, and how visitors can control them. In the European Union and the UK, the ePrivacy Directive (the "cookie law") and the GDPR require websites to give this information clearly and to get consent before setting non-essential cookies, such as those for analytics and advertising. In the US, laws like the CCPA/CPRA require disclosure and an opt-out for advertising cookies that count as "sharing" personal information. Some sites include cookie information inside their privacy policy, but a separate cookie policy with detailed tables is clearer and easier to keep up to date.

Cookie Categories Explained

CategoryExamplesConsent needed in EU/UK?
Strictly necessarySecurity, load balancing, remembering cookie choicesNo
PreferencesLanguage, theme, regionUsually yes
AnalyticsGoogle Analytics _ga, _ga_<ID>Yes
AdvertisingGoogle AdSense __gads, __gpi, IDEYes
Embedded contentYouTube YSC, VISITOR_INFO1_LIVEYes

About the Consent Banner Code

The generated banner is a single, dependency-free snippet of about 3 KB. It shows Accept all, Reject all and Customise buttons with equal prominence, as European regulators expect, stores the visitor's choice for 12 months in a first-party cookie, and exposes openCookieSettings() so visitors can change their mind at any time. It integrates with Google Consent Mode v2: it sets analytics_storage, ad_storage, ad_user_data and ad_personalization to "denied" by default, then updates them when the visitor accepts. Google Analytics and Google Ads tags adjust their behaviour automatically. It also respects the Global Privacy Control signal by leaving marketing cookies off by default, and fires a cookieconsent event you can use to load other scripts only after consent.

Important for AdSense publishers: Google requires a Google-certified CMP for serving ads to users in the EEA, the UK and Switzerland. If you show AdSense ads to those visitors, use Google's free "Privacy & messaging" consent message (or another certified CMP) for them. This banner is well suited to analytics-only sites, sites without EU traffic, and non-Google tools.

Adding the Policy and Banner to Your Site

For static HTML sites, create a cookie-policy.html page from the downloaded file and paste the banner code into the shared <head> of your template. On WordPress, add the policy as a page and insert the banner code with a header-scripts plugin, or in your theme's header.php before other tracking code. On Blogger, paste the code just after the opening <head> tag in Theme › Edit HTML. After publishing, open the site in a private window, check that no analytics or advertising cookies appear before you click Accept, and that they appear afterwards. This simple test shows your consent setup is working.

Frequently Asked Questions

Is this cookie policy generator free?

Yes. The policy and the banner code are free to use on any website, including commercial sites, with no attribution required.

Do I need a cookie banner?

If you use non-essential cookies such as analytics or ads and have visitors from the EU or UK, you need to ask for consent. Sites that only use strictly necessary cookies don't need a consent banner, but should still explain their cookies.

How do I find out which cookies my site uses?

Open your site in Chrome, press F12, and go to Application › Cookies to see every cookie with its domain and expiry. Check again after accepting the banner.

Where do I put the banner code?

At the top of the <head> on every page, before Google Analytics, Google Tag Manager or AdSense code, so the consent defaults are set first.

Is this legal advice?

No. The generator follows common practice and official guidance, but you're responsible for making sure the policy matches your website. Consult a lawyer if you're unsure.