Cookie Consent Generator

Generate GDPR-compliant cookie consent banners for your website. Free, customizable, and ready to use!

Configure your settings and generate the code

GDPR Requirements Included:

  • ✓ Clear purpose explanation
  • ✓ Accept all option
  • ✓ Reject non-essential option
  • ✓ Link to privacy policy
  • ✓ Consent stored locally

Features

  • GDPR compliant
  • 5 layout styles
  • Dark/light themes
  • Cookie categories
  • Copy-paste ready

How to Use

  1. 1
    Enter your site details
  2. 2
    Choose style and theme
  3. 3
    Select cookie types
  4. 4
    Generate and copy code

About Cookie Consent Generator

A cookie consent banner is a user interface element that appears on websites to inform visitors about the use of cookies and obtain their explicit permission before placing non-essential cookies on their devices. Cookies are small text files stored on a user's browser that remember preferences, track behavior, and enable various website functionalities. While some cookies are essential for basic website operations, others are used for analytics, marketing, and personalization purposes that involve processing personal data.

The legal framework governing cookie consent primarily comes from two European Union directives: the General Data Protection Regulation (GDPR) and the ePrivacy Directive. The GDPR, which came into effect in May 2018, establishes strict requirements for processing personal data, and since cookies often collect personal information such as IP addresses, browsing history, and behavioral patterns, they fall under its jurisdiction. The ePrivacy Directive specifically addresses electronic communications and mandates that users must give informed consent before non-essential cookies are placed on their devices.

Under GDPR and ePrivacy regulations, websites must implement what is known as "explicit opt-in consent" or "prior consent." This means that no non-essential cookies can be set until the user actively agrees to them. Pre-ticked boxes, bundled consent where accepting terms of service also grants cookie consent, and other forms of implied consent are not valid under these regulations. Only strictly necessary cookies—which are essential for the website to function—can be enabled by default without user consent.

The required elements of a compliant cookie consent solution include several key components. First, a clear and prominent banner or popup must appear before any non-essential cookies are set, making users aware that the website uses cookies. Second, the interface must provide an equal or equivalent option to reject cookies alongside the accept option—the "Reject All" button should be as visible and accessible as the "Accept All" button. Third, users must have the ability to selectively enable specific cookie categories through granular consent options. Fourth, the solution must include an easy way for users to withdraw their consent at any time, typically through a cookie settings page accessible from the website footer or banner. Fifth, a link to the full cookie policy or privacy policy must be included in the consent interface.

Cookie categories are typically divided into four main types, each serving different purposes and requiring different levels of consent. Strictly necessary cookies are essential for basic website functionality—these include session cookies that maintain user login states, shopping cart cookies that remember items selected, and cookies required for security features. These do not require consent because they are essential for the service the user requests. Functional cookies enhance user experience by remembering preferences like language settings, font choices, and region preferences—they require consent but are not used for advertising. Analytics cookies track visitor behavior, page views, time spent on site, and other metrics that help website owners understand performance—these require explicit consent under GDPR. Marketing cookies are used to build user profiles, display targeted advertisements, and track campaign performance—they require the highest level of consent and are the most heavily regulated.

The consequences of non-compliance with cookie consent regulations can be severe. Under GDPR, fines can exceed €20 million or 4% of a company's global annual revenue, whichever is higher. Data protection authorities across Europe have issued substantial fines to major companies for cookie consent violations, including examples where companies failed to obtain valid consent, used pre-ticked boxes, or made rejecting cookies unnecessarily difficult. Beyond financial penalties, non-compliance can result in reputational damage, loss of user trust, and potential civil lawsuits from affected users.

Implementing proper cookie consent requires storing consent records that demonstrate compliance. When a user provides consent, the website should record the timestamp, exactly what the user consented to (which cookie categories), the user identification information such as IP address or a unique consent ID, the version of the consent mechanism used, and any preferences the user expressed. This documentation is essential in the event of a regulatory audit or complaint. Consent should be renewed periodically—most legal experts recommend refreshing consent every 6 to 12 months to ensure it remains valid and to give users an opportunity to update their preferences.

It's important to note that regulations differ regionally. The California Consumer Privacy Act (CCPA) in the United States requires an opt-out mechanism rather than opt-in consent for certain cookie uses, meaning users must be able to easily opt out of data selling or sharing but cookies can be set by default in some circumstances. This differs significantly from GDPR's prior consent requirement. Websites serving users in multiple jurisdictions must implement the most stringent requirements or develop region-specific consent mechanisms.

Frequently Asked Questions

What is cookie consent and why is it required?

Cookie consent is the legal requirement to obtain user permission before placing non-essential cookies on their devices. Under GDPR and ePrivacy Directive, websites must get explicit opt-in consent before setting any cookies that are not strictly necessary for basic website functionality. This applies to analytics, marketing, and functional cookies that track behavior or collect personal data.

What are the GDPR requirements for cookie consent?

GDPR requires prior consent before placing non-essential cookies. This means users must actively opt in, not just continue browsing. Required elements include: clear banner explaining cookie use, equal accept and reject options, granular consent by category, easy withdrawal mechanism, and link to full privacy policy. Pre-ticked boxes and bundled consent with terms are violations.

What happens if I do not have a cookie consent banner?

Non-compliance can result in significant fines under GDPR—up to €20 million or 4% of global annual revenue. Regulatory authorities have issued fines to companies for missing consent mechanisms, using invalid consent methods, or making rejection difficult. Beyond penalties, you risk reputational damage and potential civil liability from users whose data was improperly collected.

What cookie categories require consent?

Four main categories exist: strictly necessary (no consent needed), functional (requires consent), analytics (requires consent), and marketing (requires explicit consent). Only strictly necessary cookies—which are essential for website functionality like session management and security—can be set without user permission. All other categories require valid consent before activation.

How do I make the reject button equal to accept?

The reject button must be equally prominent and accessible as the accept button. This means similar visual weight, positioning, and ease of clicking. Avoid dark patterns like burying the reject option, making it significantly smaller, or requiring extra steps. Both options should be visible without clicking to expand or scroll. Users should be able to reject with a single click.

Do I need to renew cookie consent?

Yes, consent should be periodically renewed. Most legal experts recommend refreshing consent every 6 to 12 months to ensure it remains valid and to give users an opportunity to update preferences. Additionally, you should renew consent when making significant changes to cookie categories, privacy practices, or when updating your consent mechanism to a new version.

What consent records must I keep?

You must store: timestamp of consent, what specific categories the user consented to, user identification (IP address or unique consent ID), the consent mechanism version, and any specific preferences expressed. This documentation proves compliance during audits. Store these records securely and retain them as long as needed for legal compliance.

How does CCPA differ from GDPR for cookies?

CCPA (California) requires opt-out, not opt-in consent. Users must be able to easily opt out of data selling or sharing, but cookies can often be set by default for non-sale purposes. GDPR requires prior explicit opt-in consent before any non-essential cookies. If serving both EU and California users, implement the stricter GDPR approach or use region-specific mechanisms.

Can I use pre-ticked boxes for cookie consent?

No. Pre-ticked boxes and any form of implied consent are violations under GDPR. Users must take a positive action to consent—clicking accept, toggling switches on, or explicitly choosing preferences. Bundling cookie consent with terms of service acceptance is also invalid. All consent must be freely given, specific, informed, and unambiguous.

Where should I place the cookie consent code?

Add the cookie consent code immediately before the closing </body> tag of your website, preferably in the footer or a common template file. It must load and display before any non-essential cookies are set. If using analytics or marketing tools, ensure they are wrapped in conditional logic that only activates after valid consent is obtained and stored.