How-to guide
How to Create a Chrome Extension: Beginner Tutorial (Manifest V3)
How-to
How to Create a Chrome Extension: Beginner Tutorial (Manifest V3)
On this page
- The short answer
- How do I make a Chrome extension?
- What you need before you start
- Chrome extension file structure: what manifest.json needs
- How to build a hello-world Chrome extension step by step
- How to add a background service worker
- How to inject a content script into web pages
- How to test and debug your extension locally
- How to publish your Chrome extension to the Chrome Web Store
- Examples of well-scoped extensions to learn from
- Frequently asked
The short answer
Create a folder with a manifest.json file declaring Manifest V3, a name, and a version; add a popup.html or background service worker for logic; then load it unpacked from chrome://extensions with Developer mode on. Test locally, then package and submit it through the Chrome Web Store Developer Dashboard when ready to publish.
How do I make a Chrome extension?
Every Chrome extension starts with the same file: manifest.json, which tells Chrome the extension's name, version, and what it's allowed to do. Everything else — a popup, a background script, a content script — is optional depending on what your extension needs to do.
You write extensions with the same HTML, CSS, and JavaScript used for any website, plus Chrome's own extension APIs for things a normal webpage can't do, like reading the active tab or storing data in the browser. No separate framework or build tool is required to get started.
Design for one job, not ten
Chrome's own developer guidance is explicit: choose a single, narrowly defined purpose for your extension and make it easy to understand. A tool that does one thing well is also the easiest kind to get through Chrome Web Store review.
What you need before you start
The setup is lighter than most people expect — there's no SDK to install and no account required until you're ready to publish.
- A code or text editor — VS Code is a common choice, but any plain-text editor works.
- Chrome itself, with
Developer modeenabled on thechrome://extensionspage. - Basic HTML, CSS, and JavaScript — enough to write a small popup page and a script file.
- A Chrome Web Store Developer Dashboard account, only needed at the publishing stage, not for building or testing locally.
Chrome extension file structure: what manifest.json needs
manifest.json is the only file Chrome requires by name and location — it has to sit in your extension's root folder.
{
"manifest_version": 3,
"name": "Hello World",
"version": "1.0",
"description": "A minimal example extension.",
"action": {
"default_popup": "popup.html"
},
"permissions": []
}| Field | What it does |
|---|---|
| manifest_version | Must be 3 for any new extension — Manifest V2 is retired on the Chrome Web Store |
| name / version / description | Basic metadata shown on the extension's Chrome Web Store listing |
| action | Defines the toolbar icon's behavior, including a default_popup HTML file |
| background | Registers a service worker that runs in the background, without direct DOM access |
| content_scripts | Declares JavaScript files to run inside the pages a user visits |
| permissions | Lists which Chrome APIs the extension can call, shown to users before install |
How to build a hello-world Chrome extension step by step
- Create a new folder for your extension and add a
manifest.jsonfile with the fields above. - Create
popup.htmlin the same folder with a simple heading, like<h1>Hello World</h1>. - Open
chrome://extensionsin Chrome and turn onDeveloper modeusing the toggle in the top-right corner. - Click
Load unpackedand select your extension's folder. - Click your extension's new icon in the toolbar to see the popup appear.
That's a complete, working extension. Everything from here — a background service worker, a content script, permissions — is added on top of this same structure.
How to add a background service worker
A service worker runs in the background and reacts to browser events, like a tab closing, without needing a visible popup or webpage open.
{
"background": {
"service_worker": "background.js"
}
}chrome.tabs.onRemoved.addListener((tabId) => {
console.log("Tab closed:", tabId);
});Add that background field to your manifest.json alongside action, create background.js in the same folder, then reload the extension from chrome://extensions to activate it. Service workers don't have direct access to a page's DOM — for that, you need a content script.
How to inject a content script into web pages
A content script runs inside the actual pages a user visits, which is how an extension reads or changes what's on screen.
{
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content.js"]
}
]
}document.body.style.border = "5px solid red";Save that as content.js, add the content_scripts field to manifest.json, then reload the extension and refresh any open tab — every page now loads with a red border, confirming the script ran. Narrow the matches pattern to specific sites once you move past testing, rather than leaving <all_urls> in a published extension.
How to test and debug your extension locally
Everything happens inside chrome://extensions while you're developing, with no separate test environment to set up.
- Click the reload icon on your extension's card in
chrome://extensionsafter any code change. - Right-click the toolbar icon and choose
Inspect popupto open DevTools scoped to the popup specifically. - Click
service workeron the extension's card to open a console scoped to your background script. - Use the regular browser DevTools on any tab to debug a content script, since it runs inside that page's context.
- Watch the
Errorsbutton on the extension's card — Chrome surfaces manifest and permission problems there before they show up as silent failures.
How to publish your Chrome extension to the Chrome Web Store
Publishing means packaging your folder and submitting it through Google's separate developer dashboard, not something you do from inside Chrome itself.
- Create a Chrome Web Store Developer Dashboard account and complete the one-time registration step, including its account fee, listed on the dashboard itself.
- Zip your extension's folder, or let the dashboard package it, and upload it as a new item.
- Fill in the store listing: name, description, screenshots, and a category.
- Review the developer program policies before submitting, since a violation is the most common reason a listing gets rejected.
- Submit for review; Chrome's team checks the extension before it becomes publicly visible in search.
All logic has to ship in the package
Chrome's policy is explicit: an extension can't download and run additional JavaScript at runtime. Any code your extension executes needs to be included in the package you upload, not fetched from an external server after install.
Examples of well-scoped extensions to learn from
Before you design your own extension, it helps to look at real ones that do exactly one job — the same principle Chrome's own guidance recommends for anyone submitting to the Web Store. Browse Manifest V3-ready extensions for more current examples.
Single-purpose extensions worth studying
-
Cookie-EditorFree
Developer Tools
Does one thing — view, edit, and delete cookies for the current site — a good model for a focused popup UI backed by a content or background script.
-
Productivity
A minimal content-script extension: it only adds and remembers highlights on a page, nothing else.
-
Productivity
A small, single-function tool built around one popup and one background behavior, useful as a template for simple automation.
-
MyBibFree
Research
Shows how a narrowly scoped extension can still be genuinely useful — it does one job, generating citations, and does it on any page.
-
Dark ReaderFree
Customization
A well-known example of a content-script extension that changes how a page renders without touching the page's underlying data.
Study one of these by opening its options page and thinking through what a minimal manifest and script structure for it would look like — that's a faster way to learn the patterns than starting from a blank folder. See Find Extensions for developers for more building and publishing resources.
Extensions mentioned in this guide
- Cookie-EditorView, edit, create, and delete browser cookies for any site right from the toolbar
- Super Simple HighlighterMake permanent, private highlights on any web page with a lightweight tool
- Easy Auto ClickerBeginner-friendly auto clicker with left and right click automation.
- MyBibBuild APA, MLA, and Harvard citations automatically while you browse sources
- Dark ReaderDark mode for every website.
Frequently asked
Can I create my own Chrome extension without coding experience?
A hello-world extension needs only a few lines of HTML and JSON, which is approachable without prior experience, but anything beyond a static popup requires basic JavaScript to handle logic and browser events.
Is making a Chrome extension hard?
A basic extension with a popup or simple content script is one of the easier things to build with web skills, since it reuses HTML, CSS, and JavaScript. Complexity grows once you add background logic, permissions, and Chrome Web Store review requirements.
How do I create my own extension icon?
Add an icons field to manifest.json pointing to image files at the standard sizes Chrome requests, commonly 16px, 48px, and 128px, and reference them from the action field for the toolbar icon.
Can ChatGPT make a Chrome extension?
An AI chat tool can generate a starting manifest.json and script files for a simple extension, but you still need to create the folder, load it unpacked in Chrome, and test it yourself, since the tool can't do that part for you.
Do I need to pay to publish a Chrome extension?
There's a one-time developer registration step on the Chrome Web Store Developer Dashboard that includes an account fee; check the current dashboard for the exact amount, since fees and terms can change.
What's the difference between Manifest V2 and Manifest V3?
Manifest V3 is the current required format for new Chrome extensions and replaces V2's background pages with service workers, among other API changes; V2 extensions are no longer accepted for new Chrome Web Store submissions.
Can I test a Chrome extension without publishing it?
Yes. Enable Developer mode on chrome://extensions, click Load unpacked, and select your extension's folder to run and test it locally without any Chrome Web Store account.
How long does Chrome Web Store review take?
Review time isn't fixed and varies by submission, so check your Developer Dashboard's status page for the current state of your listing rather than assuming a set number of days.
Can I build a Chrome extension using Python?
No. Chrome extensions run on HTML, CSS, and JavaScript inside the browser; Python isn't a supported runtime for extension code, though you could use it for unrelated build or automation scripts outside the extension itself.
Do Chrome extensions work on Android?
No. Chrome for Android doesn't support extensions, so anything you build only runs in desktop Chrome and other Chromium-based desktop browsers.
Where can I find a Chrome extension template to start from?
Chrome for Developers' own get-started documentation walks through a hello-world extension and several follow-up tutorials, including a popup-based tab manager and a content-script example, as a starting template.
Can I update a Chrome extension after it's published?
Yes. Increase the version number in manifest.json, upload the new package through the Developer Dashboard, and submit it for review; Chrome then rolls the update out to existing users automatically.