How to Use Response Validation in Google Forms
To add response validation in Google Forms:
- Click a Short answer, Paragraph or Checkboxes question.
- Click the three dots at the bottom right, then Response validation.
- Choose a rule, such as Number, Length or Regular expression, and type a custom error text.
Without that text, a Regular expression rule shows only "Must match pattern".
How do I add response validation in Google Forms?
Response validation, sometimes called data validation, is a rule that checks an answer before the form submits. If the answer breaks the rule, the respondent sees your error message. Here is how to add one to a phone number question:
- Add a question and choose Short answer in the question type menu.
- Click the three dots at the bottom right, then Response validation.
- Choose a rule and a condition, such as Regular expression and Matches.
- Type what the rule checks. For a 10-digit phone number, the pattern is
^[0-9]{10}$. - Type a Custom error text, then turn on Required.
Turn on Required as well. Validation only checks answers that people type, so an empty optional question still gets through.
What does "Must match pattern" mean in Google Forms?
It's Google's default error for a Regular expression rule. The answer doesn't fit the pattern, and the form owner didn't add a message to explain it.
Leave the custom error text empty, type "555-123" into the phone question, and Google shows only "Must match pattern". The respondent can't tell whether the problem is the dash, the length or something else.
- If you made the form: add a Custom error text that says what to type, like "Enter 10 digits, no spaces".
- If you're filling it in: try the answer without spaces, dashes or capital letters. If it still fails, ask the form owner what format they want.
Which validation rules can each question type use?
It depends on the question type. Short answer has the most rules, and many types have none.
| Question type | Rules you can use |
|---|---|
| Short answer | Number (such as greater than or between), Text (contains, doesn't contain, email, URL), Length and Regular expression |
| Paragraph | Length and Regular expression |
| Checkboxes | Select at least, at most or exactly a number of boxes. See limiting checkboxes |
| Multiple choice grid and checkbox grid | Require a response in each row, and limit to one response per column |
| Multiple choice, dropdown, date and time | None. Google's help lists no rules for them |
To allow only numbers, use Number with Is number, or Whole number for no decimals. For email addresses, use Text and Email. Our email verification guide covers what that rule misses.
Google Forms regular expression examples
A regular expression (regex) is a pattern that the whole answer has to follow. Choose Regular expression, then Matches, and paste one of these into the Pattern box:
| To accept | Pattern | Example answer |
|---|---|---|
| A 10-digit phone number | ^[0-9]{10}$ | 5551234567 |
| A US phone number with dashes | ^[0-9]{3}-[0-9]{3}-[0-9]{4}$ | 555-123-4567 |
| A US ZIP code | ^[0-9]{5}(-[0-9]{4})?$ | 94105 or 94105-1234 |
| Letters and spaces only | ^[A-Za-z ]+$ | Jane Smith |
| A student ID like AB1234 | ^[A-Z]{2}[0-9]{4}$ | AB1234 |
| An email from one domain | ^[^@ ]+@yourschool\.edu$ | [email protected] |
| No more than 100 words | ^\W*(\w+\W*){0,100}$ | Any answer of 100 words or fewer |
Two tips save most of the trouble:
- Use Matches, not Contains. Matches checks the whole answer, so "abc5551234567xyz" fails the phone rule. Contains only looks for the pattern somewhere in the answer.
- Test before you share. Open the preview and type one good and one bad answer. A typo in a pattern can block every respondent.
How do I set a character or word limit in Google Forms?
Use Length for characters and a regular expression for words:
- Characters: choose Length, then Maximum character count or Minimum character count, and type the number.
- Words: Google has no word count rule. Use the last pattern in the table above and change 100 to your limit.
Short answer and Paragraph both take these rules. Put the limit in the question text too, such as "In 100 words or fewer". People then know it before they start typing.
What Google Forms response validation can't do
Google Forms validation checks the format of an answer and nothing else. It falls short in five places:
- One rule per question. You can't ask for "10 digits" and "starts with 07" as two rules with two messages. You combine them into one pattern.
- Regex for everyday checks. Letters only, a phone format or a school email domain all need a pattern, and most form owners don't write regex.
- No phone format by country. A pattern for US numbers rejects a valid UK number. You need a pattern per country, or a loose one that lets typos through.
- No check that it's real. A number in the right format may not exist, and an email in the right format may not be reachable.
- No rules on choice questions. Multiple choice, dropdown, date and time can't be validated.
What do people use instead of Google Forms validation?
None of the most-installed Google Forms add-ons is built just for validation. So people end up with one of these:
| Option | How it works | The catch |
|---|---|---|
| Formfacade | Shows your Google Form in its own design, with its own validation settings | Its rules are the same types as Google's: number, text, length and regex. Paid after a 7-day trial, from $8 a month for up to 300 responses a month. |
| Apps Script | Code that runs when a response arrives | It can't stop a bad answer, only act after it's saved. Someone has to write the code and keep it working. |
| Fixing answers by hand | You correct bad answers in the linked Google Sheet | The mistakes are already in your data, and new ones arrive with every response. |
So you still write regex, pay per response, or clean up afterwards. Prices come from each maker's own pricing page.
Validate answers without regex: Google Forms vs FormNX
In FormNX, validation rules come ready-made. Open a field, click More validation rules and pick from the list. You can stack several rules on one field, and each rule gets its own error message.
| What you want | Google Forms | FormNX |
|---|---|---|
| Number, length and email checks | Yes | Yes |
| Your own error message | Yes | Yes, one per rule |
| More than one rule on a question | No | Yes |
| Letters only or letters and numbers | Only with regex | Yes, ready-made |
| Starts with or ends with | Only with regex | Yes, ready-made |
| Only emails from your domain | Only with regex | Yes, Ends With on the Email field |
| Phone numbers checked by country | No | Yes, Phone field |
| Verify an email with a code | No, add-on needed | Yes, on paid plans |
Every validation rule above is on the free plan, with unlimited forms and responses. Only the email code (OTP) is paid, in Pro from $19 a month or $190 a year, with a 30-day money-back guarantee.
There's nothing to install, no price per response and no code to look after. If you get stuck, you can ask support over live chat.
The rules you get in FormNX
- Text: Letters Only, Alphanumeric, Digits, Starts With, Ends With and Contains. The last three take a list, one keyword per line.
- Length and numbers: Minlength, Maxlength, Minimum Value and Maximum Value.
- Formats: Email, URL, Phone and Phone US. Allowed values accepts only answers from your list, such as a set of event codes.
- Phone field: pick one country, several or all. FormNX checks the number against that country's format as people type.
The validation rules documentation shows each rule with screenshots. The Phone field documentation covers the country setting.
Start faster
- Bring your Google Form. In FormNX, click New Form, then Import from Google Forms. Paste your form's public link, and FormNX copies its questions into a new form. Then swap your patterns for ready-made rules.
- See every field. The form fields page lists all 35+ field types, including Phone and Email.
Validation without writing regex
Pick ready-made rules like Letters Only or Phone. Stack them on one field, each with its own message.
Try FormNX freeFree plan available. All validation rules are free.
Common problems with response validation
| What happened | How to fix it |
|---|---|
| Response validation isn't in the three dots menu | The question type has no rules. Change it to Short answer, Paragraph or Checkboxes. |
| Every answer shows "Must match pattern" | The pattern has a typo, or it doesn't allow spaces or capitals people type. Test it in the preview and add a custom error text. |
| Wrong answers still get through | The condition is Contains, which accepts any answer that includes the pattern. Change it to Matches. |
| Blank answers get through | Turn on Required. Validation doesn't check empty answers. |
| Old responses break the new rule | Rules only apply to new answers. Fix older ones in the linked sheet. |
To compare the two builders in full, see the Google Forms alternative page.