How to Password Protect a Google Form

When you create a form using Google Forms, the form is public by default meaning it can be filled out by anyone on the Internet as long as they know the web URL of that form. If you are a Google Apps user, you can put the form behind a login screen such that only members of your domain /organization can access and fill out that form but this feature is not available to other users who have regular Google accounts.

Now there can be a scenario where you may want to password-protect your Google Forms and restrict access to certain users who have been provided the password. This feature is obviously not available in Google Forms but we can use a simple workaround that will prevent users from entering data into that form if they do not know the password.

This Google Form is password protected This Google Form is password protected

Create a Password Protected Form

Before we get into the implementation details, let’s go on a test drive. Open this Google Form and you’ll notice that it has a password field. You’ll have to enter the correct password* to see the actual form else it won’t let you move past the first screen.

PS:The form’s password is www.labnol.org (case sensitive, no spaces please)

What we have done here is split the actual form into two pages. The first page of the form has the password input field and only when the user enters the correct password are they taken to the second page that contains the actual form. Here’s a step by step guide:

  1. Go to the Google Forms editor and add a text field. Call it “Password” and make it a required question as shown in the illustration below.
  2. Expand the Data Validation section and choose Regular Expression -> Matches from the dropdown.
  3. In the input field enter the password that you would like the user to enter and enclose this string between ^$. For instance, if you are setting the form password as HelloWorld, enter ^HelloWorld$ in the validation input field.
  4. Next click the Inert menu and choose Page Break. This is the second page where you can add your regular form fields. Save the form.

Password Protect your public Google Forms Password Protect your public Google Forms

[ctrlq]

We are essentially using regular expressions to validate user input in the Google Form and proceed only if it matches a custom value.

The validation happens in the client’s browser and therefore this approach is more of a workaround and not a bullet-proof solution. Anyone with fair understanding of HTML can figure out the form’s password by either looking at the HTML source of the form or through Chrome Dev Tools.

Amit Agarwal

Amit Agarwal

Google Developer Expert, Google Cloud Champion

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.

Amit has developed several popular Google add-ons including Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

0

Awards & Titles

Digital Inspiration has won several awards since it's launch in 2004.

Google Developer Expert

Google Developer Expert

Google awarded us the Google Developer Expert award recogizing our work in Google Workspace.

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards in 2017.

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional (MVP) title for 5 years in a row.

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator title recognizing our technical skill and expertise.

Email Newsletter

Sign up for our email newsletter to stay up to date.

We will never send any spam emails. Promise.