How to password protect an HTML page or website
Quick answer
To password protect an HTML page, have a server check the password before it sends the page, or encrypt the file. A JavaScript password script leaves the password in the page source. StatiCrypt encrypts the file for free; Netlify and Vercel put a password on Pro at $20 a month (Vercel adds $20 a month per protected project), and Tiiny Host on Solo at $18. On Convika, upload the HTML file ChatGPT or Claude made, start Pro's free trial, and choose a password as you publish: 7 days free, then $12 a month.
Pro starts with a free trial: 7 days free, then $12 a month.
On this page
- Why a JavaScript password does not protect your page
- 4 ways to password protect an HTML page
- Hosts that can put an HTML page behind a password
- Password protecting your HTML page in 5 steps
- What your visitors see
- The form and the visit count behind the password
- Which method to pick
- Frequently asked questions
You ask ChatGPT for a report on last quarter's numbers, and it gives you an HTML page complete with charts and a table. That page is meant for the 6 people on your board, not for everyone who stumbles across the link. This guide explains why the usual JavaScript password keeps no one out, compares the 4 ways to put a page behind a password, and shows you how to do it on Convika, where the server checks the password before it sends the file.
Already have the HTML file? Open Convika's HTML password tool, drop the file or paste its code, and click Get my preview link. You get a preview link in seconds, without an account. Click Keep it with a password and sign up, and the page moves into your account with publishing open on the password, as in the steps below. The upload box at the top of this page makes the same preview: from it, click Keep this page — free, no card, sign up, and choose the password as you publish.
Why a JavaScript password does not protect your page
Most tutorials show the same basic snippet. It asks your visitor for a password, then compares what they typed directly inside the page's own script.
<script>
var password = prompt("Enter the password");
if (password !== "letmein") {
document.body.innerHTML = "Wrong password";
}
</script>
Your visitor's browser downloads the entire file before any script runs. The password and the hidden text arrive on their computer right away. Anyone can press Ctrl+U in Chrome on Windows to open View Source, where both sit in plain text. If someone turns JavaScript off, the prompt never appears at all. In our test on October 13, 2026, we published a page with this snippet and fetched it using curl without a browser. The raw response contained the password and the exact sentence the script was supposed to hide.
Security references call this mistake CWE-602, “Client-Side Enforcement of Server-Side Security” from MITRE: “When the server relies on protection mechanisms placed on the client side, an attacker can modify the client-side behavior to bypass the protection mechanisms”. On Stack Overflow's question about password protecting a page with HTML, viewed 62,850 times, one answer puts it plainly: “Any password logic in css or html (or even javascript) would be useless as all of this 'code' is downloaded to the client. You need to have the password check done on the server-side.”. The accepted answer recommends a password file on the server. The highest-voted answer suggests encrypting the content so only the correct password can decrypt it inside the browser, which is how StatiCrypt works.
Do not confuse this script with <input type="password">. That tag only masks characters as you type them into a form field. It protects nothing else on the page.
4 ways to password protect an HTML page
| Method | Where the password is checked | Can someone read the page without it? | Your own domain | What you set up |
|---|---|---|---|---|
| Convika's page password, or another host's password feature | The host's server | No | Yes on Convika; other hosts in the next table | A password you choose as you publish |
| JavaScript prompt | In the visitor's browser | Yes: the password and the text are in the source | Any host | Paste a script |
| StatiCrypt (encrypt the file) | In the browser, by decrypting | Not without the password, but anyone can download the encrypted file and try passwords offline | Any host | Encrypt on its web page or with its command line tool, then host the file; encrypt again after every edit |
Basic authentication (.htaccess and .htpasswd) | Your web server | No | Yes | An Apache server you control |
- A host's password feature, such as Convika's, checks passwords on the host's server, just like Basic authentication. You do not edit server files or install extra tools.
- StatiCrypt is free and open source. As its README explains, it “uses AES-256 and WebCrypto to encrypt your HTML file,” and your browser decrypts the page. Anyone can download the encrypted file. The README warns that “brute-force/dictionary attacks would be easy to do at a fast pace: use a long, unusual password.” When ChatGPT or Claude changes your page, you encrypt the new file and upload it again.
- Basic authentication stops visitors at the server door. Your browser prompts you for a user name and password before the server sends any page data. On Apache, you create a password file with the
htpasswdtool and link an.htaccessfile to it, following Apache's authentication guide. This setup works only when you control a server that runs.htaccessfiles.
Hosts that can put an HTML page behind a password
Here is how different hosts put an HTML page behind a password. Each detail comes directly from each company's own pages, checked October 13, 2026.
| Host | Password on the live page | Cheapest plan with it | Your own domain | Visitors need |
|---|---|---|---|---|
| Convika | Yes, for each page | Pro, 7 days free, then $12 a month ($108 a year) | 1 subdomain on Free, no limit on Pro | The password |
| Netlify | Yes, for the site or a folder | Pro, $20 a month | Yes | The password |
| Vercel | Yes | Pro, $20 a month, plus $20 a month per protected project | Yes | The password |
| Cloudflare Pages | No shared password; an Access policy can email visitors a code | Access Free, up to 50 users | Needs an Access app for the domain | An allowed email address |
| GitHub Pages | No | Private sites need GitHub Enterprise Cloud | Not applicable | Read access to the repository |
| Google Sites | No | Free | Yes | To be added by name or email |
| Notion | No | Not applicable | Not applicable | A Notion account, by invite |
| ChatGPT Sites | No password in its docs | Plus and above | Where custom domains are available | To sign in with the invited account |
| Tiiny Host | Yes | Solo, $18 a month ($13 a month billed yearly) | Solo and up | The password |
- Netlify: According to Netlify's docs, “Basic password protection for your entire site is available on all Pro plans,” and “Password protection isn’t available on Credit-based Free and Personal plans,”. For one folder, a
Basic-Authrule in a_headersfile asks for a password on that folder's pages. Netlify's docs state: “This feature is available on all Pro and Enterprise plans”. Pro costs $20 a month on Netlify's pricing page. - Vercel: Vercel's Deployment Protection docs list Password Protection as “Available on Pro for $20 per month per protected project and included on Enterprise at the team level. Not available on Hobby.” Pro itself costs $20 a month (pricing).
- Cloudflare Pages: The built-in access setting “will only protect your preview deployments,” not the live site (Cloudflare's docs). For the live site, Cloudflare Access can email a one-time PIN: “If the email is allowed by an Access policy, you will receive a PIN in your inbox” (one-time PIN). Access is free up to 50 users.
- GitHub Pages: According to GitHub Docs, “GitHub Pages sites are publicly available on the internet, even if the repository for the site is private”. Private publishing needs GitHub Enterprise Cloud. Then, “A privately published site can only be accessed by people with read access to the repository” (GitHub Docs).
- Google Sites: Choose Restricted instead of Public. Then, “you can share your site with specific people and add groups” (Google's help).
- Notion: Notion's help states: “Can I password protect a page? Unfortunately, not at the moment”.
- ChatGPT Sites: OpenAI's docs note that “For limited sharing, invited visitors must sign in with the account that received access.” OpenAI's Sites help, read November 6, 2026, says “ChatGPT Sites is available to ChatGPT Plus and Pro accounts, as well as Business and Enterprise workspaces.”
- Tiiny Host: Plans in the code of its pricing page list “Password protection” (“Restrict who can view your content by adding a password”) from Solo, at $18 a month or $156 a year. Its feature page notes: “Toggle on password protection with 1-click protection.”
To see what else these hosts include, read Tiiny Host alternatives compared and Netlify's free plan. Each host's password, plan by plan: Vercel, Netlify, and Cloudflare Access.
Each host's plan and price for a password, side by side with Convika, is in Password-protected HTML hosting compared.
Password protecting your HTML page in 5 steps
Open the password tool and drop your file
Open Convika's HTML password tool. Drop your .html file on the box, or switch to Paste code and paste what ChatGPT, Claude, Gemini, or Codex wrote. Click Get my preview link. You get a preview link in seconds, with no account and no card. Convika accepts .html and .htm files up to 4 MB. Nothing is public yet, and this preview link has no password: the password goes on the page you publish in the next steps.
Keep the page with a password
Click Keep it with a password on the result and sign up. You do not need a credit card to sign up. The page moves into your account, and publishing opens with Only people with the password already chosen under Who can open this page?.
Already have a Convika account? On your dashboard, click Upload an HTML file. Drop your file onto the Upload a file tab, or open Paste code and paste the code, then click Create my preview. Your private preview link works for 3 minutes, and Open preview gives you a fresh one whenever you click it. Click Publish page and choose Only people with the password.
Choose the password
Passwords come with Pro, so start Pro's free trial first with Try Pro free for 7 days in the sidebar (then $12 a month, cancel any time before the trial ends). Then, on the page's screen, click Publish page, choose Only people with the password, type a password of 8 to 128 characters using letters A–Z, numbers, symbols, or spaces, and click Publish with password. On Pro, you can also add or change a password any time under Page password in Page settings with Add password.
Publish
Your page goes live behind the password at an address like yourpage.convika.page. If you want to use your own subdomain, such as docs.yourbrand.com, click Connect my domain under Custom domain on the page's dashboard screen. Free accounts include 1 custom subdomain, and Pro accounts have no limit.
Send the link and the password separately
Send the link in one message and the password in another. For example, email the link and text the password. Anyone who opens only the link sees the password screen.
What your visitors see
Here is what happens when someone visits your protected link. On October 13, 2026, we tested 5 test pages behind a password this way, opening them in a browser that had never signed in, and with curl.
- A password screen at your address. It says “This page is password protected,” with one field and a View page button. The screen follows your visitor's browser language: a browser set to Japanese shows it in Japanese. A language Convika doesn't have gets English.
- None of the page until the password is right. The screen returns a 401 status. In our test, the response held neither the page's title nor any of its text. Convika checks the password on its server before sending the page. You get the same result on the first visit to a page whose password was added before its first publish.
- A wrong password shows “That password doesn't match. Check it and try again.” If an IP address enters 10 wrong passwords within 15 minutes, the screen asks the visitor to wait before trying again.
- The right password opens the page, and the browser isn't asked again while it keeps opening it. In our test, reloading opened the page without asking again. The password screen comes back only after 30 days without opening the page.
- A new password locks everyone out again. After you click Change password, everyone who entered the old one sees the password screen on their next visit. Selecting Remove password leaves the page open to anyone with the link.
- Search engines see only the screen. The screen is marked noindex, and Convika leaves the page out of your address's sitemap. Browsers, and caches, are told not to keep a copy.
- Your preview link skips the password. The dashboard's preview link opens the page without it so you can review your work. Send the published address when you share it with others. For a client's sign-off on a draft, see how to collect their feedback and confirm the changes.
- Publishing again keeps the password. In our test, a new version published after the password was added still showed the password screen.
If you don't keep Pro. Your page never goes public by itself. If your Pro, MAX, or pass ends without payment, the page goes offline; choose Pro again, or publish it as Public on Free, to bring it back.
The form and the visit count behind the password
- The form works only for people who entered the password. Turn on Add a form to my page on the page's dashboard screen. Entries land in your dashboard. Pro has no monthly cap. In our test, an entry sent from a browser without the password returned a 401 and was not saved. An entry from the visitor who entered the password appeared in the dashboard. Read How to make the form on your AI-made page work.
- Visits count once the password is right. The screen itself is not counted. In our test, one browser stopped at the screen and one visitor got through. That resulted in 1 pageview and 1 visitor in the dashboard. Read How to see who visits your page.
Which method to pick
- A page ChatGPT or Claude made, on your own domain, behind a password, with a form and visit counts: Choose Convika. Pro starts with a free trial: 7 days free, then $12 a month, and you can cancel any time before the trial ends.
- You only want to keep the page out of Google, and anyone with the link can open it: You don't need a password for that. On Convika, choose Private link (Pro) when you publish—anyone with the link can open the page without a password or account, while Convika tells search engines to keep it out of their results and leaves it out of the sitemap (step up to Only people with the password if the link might get forwarded). The free Public choice may show up in search results and in Convika's gallery. On any host, adding
<meta name="robots" content="noindex">in the page's<head>also asks search engines to keep it out of results. - You run an Apache server: Use basic authentication. You pay nothing extra. Your own server checks the password before it serves the page.
- One file for a few people, on any host: Pick StatiCrypt. It is free. Choose a long, unusual password, because anyone can download the encrypted file and guess passwords offline.
- The site is already on Netlify Pro or Vercel Pro: Turn on their built-in password feature. Use the prices listed above.
- Each viewer must sign in as themselves, or you need to know who opened it: Set up an identity-based gate, such as Cloudflare Access with emailed codes.
- A proposal or quote for one client: A password keeps the prices from anyone the link is forwarded to. How to send a client an HTML proposal as a link walks through it.
Skipbox
Cheap & fast GitHub Actions runners, unlimited for $39 a month
Your own machine keeps Docker layers and package caches between jobs. Switch by changing one runs-on line.
Start a free Skipbox trialFrequently asked questions
Can you password protect an HTML file?
Yes, two ways hold up: host it where a server checks the password, or encrypt the file. Convika, with Pro, sends the page at its published address only after the visitor enters the right password. StatiCrypt encrypts the whole file, and the browser decrypts it after you enter the right password. A password written directly into the file's HTML or JavaScript does not count. Anyone with the file reads it.
Is a JavaScript password on an HTML page secure?
No. The password and the content both sit inside the downloaded file. Using View Source or curl shows them right away. If a visitor turns JavaScript off, their browser skips the prompt completely. MITRE tracks this flaw as CWE-602, client-side enforcement of server-side security. Have a server check the password: Convika's Page password, Basic authentication, or another host's password feature.
Is there a password protection script for a website?
Not one that runs in the page. A JavaScript password script is downloaded with the page, so the password and the text it hides sit in the source, as our curl test showed. The check must run on the server: Convika's Page password, Basic authentication with .htaccess and .htpasswd on Apache, or another host's password feature. StatiCrypt is the in-browser method that holds up, because it encrypts the page instead of hiding it.
How do I encrypt an HTML file with a password?
Use StatiCrypt, which is free and open source. Its README says it “uses AES-256 and WebCrypto to encrypt your HTML file,” on its web page in your browser or with its command line tool (npx staticrypt). Upload the encrypted file to any host. Anyone can download that file and try passwords offline, so use a long, unusual password, and encrypt the file again after every edit.
How do I put a password in HTML?
HTML alone cannot protect a whole page with a password. To hide characters on the screen as someone types in a form, you use an <input type="password"> field. For a full page that asks for a password, HTML cannot do the job on its own. A server must check the password before sending the page, or you must encrypt the file using one of the 4 ways above.
How do I make a password protected HTML page without coding?
Open Convika's HTML password tool, drop your file in or paste your code, and click Get my preview link. Click Keep it with a password and sign up. Start Pro's free trial with Try Pro free for 7 days in the sidebar, then click Publish page, choose Only people with the password, type a password, and click Publish with password. The page goes live behind the password. You have nothing to install, and you never edit server files.
Can you password protect GitHub Pages?
No, you cannot protect GitHub Pages with a password. GitHub's docs state that Pages sites stay public even when your repository is private. Private publishing requires GitHub Enterprise Cloud, which lets only people with read access to the repository open the site. To use a password, publish the page on Convika with one, or encrypt the file with StatiCrypt before pushing. Read more on Can you use GitHub Pages for a business site?.
Can you password protect a Google Sites page?
No, Google Sites has no password setting. Google's help explains that you set the published site to Restricted and share it with specific people by name or email. If you need to share your page with people you cannot add by email, publish the page on Convika with a password.
Can you password protect a Notion page?
No. Notion's help states: “Can I password protect a page? Unfortunately, not at the moment.” You must invite people with a Notion account instead. If you want a password, publish your content as an HTML page on Convika with one, and paste its link into Notion as a bookmark.
How do I password protect a Netlify or Vercel site?
Both Netlify and Vercel require a paid plan for passwords. Netlify offers password protection on Pro for $20 a month, which covers the entire site. To lock a single page on Netlify, you place it in a folder and write a Basic-Auth rule for that folder in a _headers file, which also requires Pro. Vercel charges $20 a month per protected project on top of its $20 a month Pro plan, and leaves the feature off Hobby. Tiiny Host charges $18 a month on Solo. Convika includes it with Pro: 7 days free, then $12 a month.
How do I share a password-protected link?
Send the link and the password in separate messages. On Convika, the link is the page's own address. The opener sees the password screen first, and typing the right password lets their browser open the page from then on; it asks again only after 30 days without opening the page. Tools that only lock a link, like Link Lock, work differently. As its README explains: “If the password is correct, Link Lock retrieves the original URL and then redirects there,” which means anyone who learns the real address skips the password.
Can each page have its own password?
Yes, on Convika each page can have its own password. You choose it when you publish the page, or on Pro under Page password in Page settings on that page, while pages without one stay public. That keeps two versions of a tool apart: a quote calculator built from an Excel price sheet puts the staff page, with costs and margins, behind a password, and the client page, with prices only, at its own link. Netlify sets a site-wide password that covers every page, or uses a Basic-Auth rule for one folder. Vercel charges you per protected project. A Convika password is shared by everyone you give it to, without separate passwords for individual viewers.
Next step
How to see who visits a page you made with AI
Convika shows a page's visits, sources, and button clicks with no tag. GA4, Plausible, Clarity, and Cloudflare: free tier, tag, and source report.
Related articles
- Password-protected HTML hosting compared: Netlify, Vercel, Cloudflare Access, Tiiny Host, GitHub PagesPut a password on an HTML page: Convika Pro with a 7-day free trial, checked on the server. Netlify, Vercel, Cloudflare Access, Tiiny Host, and GitHub Pages by plan, price, and setup.
- How to share a Playwright HTML report as a linkUpload the playwright-report folder and send one link. Screenshots and the trace viewer work for whoever opens it, with a password on Pro.
- Does Vercel password protection cost extra, and on which plan?Yes: $20 a month per protected project on top of Pro, and not on Hobby. Plans, scope, setup, and what viewers see, from Vercel's docs, read November 25, 2026.
- Can you password protect a Netlify site on the free plan?No: Netlify's password is on Pro at $20 a month, not on Free or Personal. Plans, scope, setup, and what viewers see, from Netlify's docs, read November 25, 2026.
- Can Cloudflare Access put a password on a static site?Not a shared password: Access emails each allowed viewer a one-time PIN, free up to 50 users. Pages and Workers setup, from Cloudflare's docs, read November 25, 2026.
- How to share an HTML app internally: 9 ways compared (GitHub Pages, SharePoint, Google Drive, your own server)One password link for your HTML app, with fixes at the same link. Convika, GitHub Pages, SharePoint, Google Drive, Apps Script, Netlify, and more compared.