What is an allowed values check?

Many fields accept only a fixed set of values: a T-shirt size of S, M or L, an order status of pending, shipped or delivered, a yes or no answer. An allowed values check, also called an "in list" or enum check, tests whether a value is exactly one of the entries of such a list.

Developers use it to test the rules behind dropdowns, settings and API parameters, since a request can send a value the dropdown never offered. Anyone tidying up a spreadsheet can use it to spot an entry such as Large in a column that should only hold large.

Tool description

Type or paste a value into the Value field, and enter the accepted values into Allowed values, one per line. The result shows as you type: "The value is in the list." or "The value isn't in the list." Spaces around the value are ignored. With a value in the field but no list yet, it reads "Fill in “Allowed values, one per line” to see the result." An empty Value field shows no result.

How the list is read

  • Each line holds one value, so red, green on one line is a single value with a comma in it, not two
  • Spaces at the start and end of each line are dropped, and blank lines are skipped
  • Spaces inside a value count: a value with two spaces between its words doesn't match the same words with one
  • The whole value has to match a line: med isn't in a list that has medium
  • Capital and small letters count: with small in the list, Small and SMALL aren't in it
  • Accents count too: cafe doesn't match café

Good to know

  • The page compares text, not numbers, so 1 doesn't match 01, and 10 doesn't match 10.0.
  • To check against a column of a spreadsheet, copy the column and paste it as the list: each cell lands on a line of its own. Duplicate lines do no harm, and the Duplicate lines remover tidies them up if you want a clean list.
  • To compare two whole texts instead, use the String Equality Checker.

Features

  • Checks a value against a list you type or paste
  • One value per line, with spaces around each line ignored
  • Exact matching that tells capital and small letters apart
  • Results as you type, with no button to press
  • Runs in your browser, so nothing you type is sent anywhere