All tools
SEO Tools
Ads Tools
Link Tools
Social Tools
Text & Content Tools
Utilities
Finance Calculators
Thai Business
Image & Media Tools
Numerology & Fortune
Home & Living
Education
Health

Cookie Consent Banner Generator

Build a lightweight cookie consent banner you can paste onto any website in seconds. Choose your categories, position, colour and language, then copy one self-contained snippet — HTML, CSS and JavaScript in a single block. It stores each visitor’s choice in their browser and gives a clear way to accept, reject, or manage cookies, which sits at the heart of PDPA and GDPR compliance.

Optional. Shown as a small heading above the message.

The consent text visitors see. Edit it freely — it appears exactly as you type.

Cookie categories

Choose which categories visitors can control. Necessary cookies are always on.

Where the banner appears on your site.

#2563eb

Used for the primary “Accept” button and links.

Optional. Adds a link to your policy inside the banner.

Language of the buttons and category labels in the generated banner.

Live preview

Illustration only — options are shown expanded so you can see every category.

Generated code

Paste this once, just before the closing </body> tag on every page.

Consent is stored in the visitor’s browser (localStorage) and exposed as window.cookieConsent. This tool helps you build a banner but is not legal advice.

How to use

  1. Enter your site name and edit the consent message.
  2. Pick the cookie categories, banner position, accent colour and language.
  3. Watch the live preview on the right update as you change settings.
  4. Click “Copy code” and paste the snippet before the closing </body> tag on every page.

Features

  • Self-contained HTML + CSS + JavaScript — no libraries or external requests
  • Accept all, reject non-essential, and manage-by-category controls
  • Necessary cookies locked on; analytics, marketing and preferences optional
  • Three layouts: bottom bar, corner box, or centered modal
  • Thai, English, or bilingual banner text
  • Remembers consent in localStorage and exposes window.cookieConsent for your scripts

Frequently asked questions

Does this make my site PDPA or GDPR compliant?
It gives you the core building block both laws expect: a clear notice with a real choice to accept or reject non-essential cookies before they load. Full compliance also depends on actually blocking tag scripts until consent is given, keeping a privacy policy, and honouring withdrawals. Treat this tool as a starting point, not legal advice.
How does my site know what the visitor chose?
The snippet saves the choice in the browser’s localStorage under the key “cookie_consent” and sets window.cookieConsent to an object like {necessary:true, analytics:false, marketing:true}. Your own scripts can read that object, or listen for the “cookieconsent” event, and only fire analytics or ads tags when the matching category is true.
Is anything sent to a server?
No. Everything runs in your browser and the generated banner is fully self-contained. Metools never sees your settings, and the banner makes no external calls, so it will not slow your pages or leak visitor data.
How do I let visitors change their mind later?
The snippet exposes window.showCookieConsent(). Add a “Cookie settings” link in your footer that calls it, and the banner reappears so visitors can update or withdraw consent — something PDPA and GDPR both expect you to make easy.
Will the banner block Google Analytics or Meta Pixel automatically?
No — it records the decision but cannot know about every tag on your site. You wire it up by checking window.cookieConsent.analytics or .marketing before loading those scripts, so they only run once the visitor has opted in.