Back to Blog
🤖

Response Validation Google Forms: Rules, Regex and Examples

Response validation in Google Forms checks answers before submit. See every rule by question type, regex for phone and ZIP codes, and error text tips.

Response validation in Google Forms is a rule you attach to a question so the form refuses an answer that doesn’t fit, before the person can submit. To turn it on, open the question, click the three-dot More menu at the bottom right, choose Response validation, pick a rule, and optionally write a custom error message. The rules you can pick depend on the question type: short answer, paragraph, and checkboxes questions each have their own list (Google Docs Editors Help).

This guide covers how to set it up, every rule Google lists, ready-to-paste regular expressions, and the limits worth knowing before you rely on it.

How to add response validation in Google Forms

These steps follow Google’s own help page, How to set rules for your form:

  1. Open your form in Google Forms.
  2. Add a question, or click an existing one.
  3. Choose the question type to the right of the question title (for example Short answer).
  4. Click More (the three dots at the bottom right of the question card).
  5. Click Response validation. A new row of drop-downs appears under the question.
  6. Pick the type of rule, then the condition, then the value.
  7. Optional: type a message in the Custom error text field. Responders see it when their answer breaks the rule.

Before you share the form, open the preview, submit a wrong answer on purpose, and check that your error message shows up. Then submit a correct answer and make sure it goes through.

Response validation rules by question type

Google lists different rule sets for each question type (source):

Question typeRuleWhat it doesExample
Short answerNumberThe answer must be a number that meets a conditionA number between 21 and 42
Short answerTextThe answer must contain (or not contain) certain text, or be an email or URLMust be in email format
Short answerLengthSets a maximum or minimum character countAt most 500 characters
Short answerRegular expressionThe answer must match (or not match) a patternA 10-digit phone number
ParagraphLengthSets a maximum or minimum character countAt least 200 characters
ParagraphRegular expressionThe answer must match (or not match) a patternContains a reference code
CheckboxesSelect at least / at most / exactlyControls how many boxes can be checkedSelect exactly 3 options

Grid questions work a little differently. For a multiple choice grid or checkbox grid, Google offers Require a response in each row and, under More, Limit to one response per column and Shuffle row order. These are settings on the grid rather than entries in the Response validation menu.

If you are still choosing which question type to use in the first place, our guide to different question types in forms explains when each one fits. For rating questions specifically, see how the linear scale in Google Forms works.

Common response validation examples

Email address

Choose Short answer, then Text, then Email. Google Forms will reject anything that isn’t in the format [email protected]. Keep in mind this only checks the format. It can’t tell you whether the mailbox exists. If bad addresses are costly for you, read our guide on how to validate email addresses, which covers domain and deliverability checks.

A number in a range

Choose Short answer, then Number, then Between, and enter the two limits. This works well for an age, a quantity, or a year. Write the error text so the person knows exactly what to fix, for example “Enter a whole number between 18 and 99.”

A maximum length for an answer

Choose Paragraph (or Short answer), then Length, then Maximum character count. Google’s own example is limiting an answer to 500 characters. Note that the limit counts characters, not words, so say “characters” in your error text.

Pick exactly N options

Choose Checkboxes, then Select exactly, and enter the number. This is useful for questions like “Pick the three features you use most,” where you want the same number of answers from everyone.

Regex examples for Google Forms response validation

The Regular expression rule lets you require a pattern. Pick Matches or Contains (or their negatives), then paste the pattern. The first two patterns below come from Google’s help page; the others are common patterns you should test in preview before you go live.

What you wantPatternAcceptsRejects
10-digit phone number[0-9]{10}1234567890123-456-7890
US ZIP code (with optional +4)[0-9]{5}(-[0-9]{4})?12345, 12345-67891234
Answer that starts with a lowercase letter^[a-z].*bobBob
Email from one company domain^[A-Za-z0-9._%+-]+@yourcompany\.com$[email protected][email protected]
Order code like AB-1234^[A-Z]{2}-[0-9]{4}$AB-1234ab1234

Two rules from Google’s regular expression reference save a lot of confusion (source):

  • ^ anchors the start of the answer and $ anchors the end. Without them, a pattern can match part of a longer answer.
  • Characters that mean something in regex, such as . or $, need a backslash in front when you mean the literal character. That’s why the company email pattern uses \.com.

Writing a custom error message that helps

Google Forms lets you write your own error text for every rule. A generic error tells people they are wrong, but not what to do. Good error text names the expected format and gives an example:

  • Instead of “Invalid”, write “Enter your phone number as 10 digits, no spaces (for example 5551234567).”
  • Instead of “Wrong format”, write “Use your work email ending in @yourcompany.com.”
  • Instead of “Too long”, write “Keep your answer under 500 characters.”

Limits of response validation in Google Forms

  • Not every question type has it. Google’s help page lists rules for short answer, paragraph, and checkboxes questions, plus the grid settings above. Multiple choice and drop-down questions already limit people to the options you give, so they don’t need it.
  • Format is not truth. A valid-looking email or phone number can still be fake or mistyped. Validation catches typos and wrong formats, nothing more.
  • Responders can get stuck. Google tells responders that if a validation rule is wrong or blocks the information they need, they should contact the form owner (Google Docs Editors Help). Test every rule in preview so that doesn’t happen to your audience.
  • One rule per question. The menu lets you pick one rule type for each question. If you need several conditions at once, a single regular expression is usually the way to combine them.

If your form needs more than this, such as checks that depend on earlier answers or file rules, compare the options in our list of Google Form alternatives, or see how Google Forms file uploads handle their own limits.

FAQ

Where is response validation in Google Forms?

Click the question, then the three-dot More menu at the bottom right of the question card, then Response validation. If you don’t see it, check the question type: it appears for short answer, paragraph, and checkboxes questions.

Can Google Forms validate an email address?

Yes. Use a short answer question with the Text rule set to Email. It checks that the answer looks like an email address, not that the mailbox exists. Google Forms can also collect the respondent’s email for you through the form’s settings, which avoids typing errors altogether.

How do I limit the number of checkboxes someone can select?

Use response validation on a checkboxes question and choose Select at most (or Select exactly), then enter the number.

Can I use regex in Google Forms?

Yes. Choose Regular expression in the response validation menu on a short answer or paragraph question, then pick Contains, Doesn’t contain, Matches, or Doesn’t match and enter the pattern.