Start a project

Tool 300 of 450 · Consent

Cookie Banner Generator

Build a lightweight, accessible cookie consent banner that blocks non-essential scripts until consent.

Cookie Banner Generator

Your input

Result

    Banner (paste before )
    How to tag your scripts

    01

    What it does

    Build a lightweight, accessible cookie consent banner that blocks non-essential scripts until consent.

    • Accept all, Reject all and Settings with per-category toggles
    • Blocks tagged scripts until the visitor consents
    • Reject as prominent as Accept (ICO guidance)
    • Google Consent Mode v2 defaults and updates (optional)

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    Banner HTML, CSS and JS, and compliance checks, with a Copy and a Download button on every result.

    • Cookies
    • Consent
    • PECR

    Why it matters

    Under UK GDPR and PECR, non-essential cookies need consent before they're set, refusing has to be as easy as accepting, and people need a way to change their mind.

    Many banners just hide a notice without blocking anything. This one keeps analytics and marketing scripts inert until consent, then switches on only the categories chosen.

    How to use it

    1. Type or paste your input; the example shows the format.
    2. Press Build banner. Results also update as you type.
    3. Read the summary line, then the table, notes or output below it.
    4. Copy or download what you need. Nothing leaves this page.

    FAQ

    How do I block a script until consent?

    Change its type to text/plain and add data-consent="analytics" (or marketing, functional). The banner turns it back into a real script once that category is accepted.

    Does the banner itself set a cookie?

    It stores the choice in localStorage by default, which is allowed as strictly necessary for remembering consent. You can switch to a first-party cookie.

    Do I need a banner at all?

    Not if you only use strictly necessary cookies and cookieless analytics. This site, for example, has no banner because it sets no cookies.

    Is my input uploaded?

    No. The tool runs in your browser and nothing you type, paste or open is sent anywhere.

    Can I rely on the result?

    It follows the ICO's guidance on cookies and similar technologies (UK GDPR and PECR) and Google's Consent Mode v2 parameter names. It isn't legal advice; check your cookie policy describes what you actually use.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk