Generate a GDPR-compliant cookie consent banner with ready-to-use HTML, CSS & JavaScript. Free, no signup.
Lets users decline non-essential cookies
Links to a cookie preferences panel
Adds a close button in the corner
Banner disappears immediately after clicking Accept
We use cookies to enhance your experience on our website. By continuing to browse, you agree to our use of cookies.
A cookie consent banner is a notification displayed on a website informing visitors that the site uses cookies and requesting their permission before storing cookies on their device. Since the implementation of the GDPR in Europe and similar regulations worldwide, displaying a cookie consent banner has become a legal requirement for most websites that collect user data.
Our free Cookie Consent Banner Generator creates a fully functional, customizable banner with clean HTML, CSS, and JavaScript code that you can paste directly into your website. No external libraries, no tracking scripts, no dependencies — just lightweight code that works everywhere.
Under the GDPR (General Data Protection Regulation), the ePrivacy Directive, the CCPA (California Consumer Privacy Act), and other data protection laws, websites must obtain informed consent before placing non-essential cookies on a visitor's device. Failure to comply can result in significant fines — up to €20 million or 4% of annual global revenue under the GDPR.
A well-designed cookie consent banner demonstrates to your visitors that you respect their privacy and are transparent about your data collection practices. This builds trust and improves user confidence in your website.
Heavy third-party cookie consent solutions can slow down your website and negatively impact Core Web Vitals scores. Our generator produces lightweight, self-contained code that loads instantly and has zero impact on your page speed — giving you compliance without sacrificing performance.
Customizable design — Choose from four banner positions (bottom bar, top bar, center popup, or bottom-left corner), three themes (light, dark, or custom colors), and adjust the primary and text colors to match your brand identity perfectly.
Flexible button options — Configure accept, reject, and manage preferences buttons with custom text. Toggle visibility of each button based on your compliance needs and user experience preferences.
Self-contained code — The generated code uses vanilla JavaScript with no external dependencies. It stores the user's consent choice in a browser cookie for 365 days and hides the banner automatically on return visits.
Live preview — See exactly how your banner will look before generating the code, making it easy to fine-tune the appearance and layout.
After generating your banner code, copy the complete output (CSS + HTML + JavaScript) and paste it just before the closing </body> tag of your website. The banner will appear automatically on every page load until the visitor makes a choice. Their preference is saved for one year.
For platforms like WordPress, Shopify, or Squarespace, paste the code into your theme's footer section or use a custom HTML block. For single-page applications built with React, Next.js, or Vue, you can include the code in your main layout component.