Skip to content
M2TOOLKIT

Developer · free tool

Cookie Consent Banner Generator

Add a simple, accessible cookie banner to any website.

Use it as often as you like — it's free, with no sign-up and no limits.

  • Developer
  • Free
  • No sign-up
  • Runs in your browser
  • Updated
Theme
days

Preview

The banner stores the choice in localStorage and fires a cookie-consent event — load analytics only when analytics is true. Equal-weight Accept and Reject buttons are what EU regulators expect; this isn't legal advice.

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us.

How to use the Cookie Consent Banner Generator

  1. Write your banner text and choose colours, position and buttons.
  2. Check the live preview.
  3. Paste the code before the closing </body> tag.

What does this tool do?

The banner is about 2 KB with no dependencies or tracking of its own. It saves the visitor's choice in localStorage, asks again after the number of days you choose, and fires a cookie-consent event so you can load analytics or ads only after consent. Accept and Reject are equally prominent, as EU regulators expect.

Everything runs in your browser — nothing you paste is uploaded.

Why use it?

  • No dependencies.
  • Equal accept/reject.
  • Consent event for scripts.

Use cases

  • Add a banner to a small site without a paid platform.
  • Load analytics and ads only after consent.
  • Replace a heavy consent script with a lightweight one.

Loading analytics only after consent

Put your analytics script behind the banner: when a visitor accepts the analytics category, the banner fires its consent event and your code loads the script. If they reject, it never loads. Both buttons are equally prominent.

Common mistakes

  • Loading tracking scripts before the visitor chooses.
  • Hiding the reject button or making it harder to find than accept.
  • Never asking again after your cookie use changes.

Accuracy and limits

  • A banner alone doesn't make a site compliant — you must also stop non-essential cookies until consent is given. This isn't legal advice.

Privacy

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.

Frequently asked questions

Does it make my site compliant?

It helps, but compliance also depends on what you load and your privacy policy. Get advice if you're unsure.

Where is the choice stored?

In the visitor's localStorage, so the banner doesn't reappear until the period you set.

How big is it?

About 2 KB, with no dependencies.

Content last updated . See how M2Toolkit works.

Other tools people use alongside the cookie consent banner generator.