Documentation

MaxDiff Question

When and Why to Use

Use this to identify the most and least preferred items from a set. It's ideal for:

  • Prioritizing features, messages, or concepts
  • Understanding tradeoffs in preferences
  • Reducing scale bias compared to traditional rating questions

Supports full MaxDiff logic with dynamic sets, randomization, and chat and traditional display styles.

Chat Experience
  • Respondents answer twice per set: once for each label (e.g. "Least" and "Most")
Traditional Experience
  • Each set is shown once with both labels side by side (e.g. "Select Least and Most")
  • Ideal for desktop or larger screen interactions
Chat experienceTraditional experienceTraditional experience on mobile
Markdown 2B Many OptionsMaxdiff Question Figure 01Maxdiff Question Figure 02
Configuration Options
OptionTypeRequiredDefaultDescription
questionstringyes-Prompt shown above the MaxDiff sets
itemsList[str] or List[List[str]]yes-Flat list (auto-generated sets) or custom list of sets
labelsList[str]yes-Two labels for the selection ends (e.g. ["Least", "Most"])
imageMediaItemno-Optional image shown above the sets
randomizeboolnoFalseRandomize item order per set
custom_validatorCallable[[str], str] | Noneno-Function that returns a custom error message
dont_know_optionstrno-Optionally adds a "Don't know" choice
image_label_fieldstrno-Label field to use for media items in the options
show_image_labelboolnoTrueWhether to show image labels for media options
image_sizeTuple[int, int]no-Bounding box size for media options
number_secondsintno0Seconds to wait before allowing the respondent to continue
tagss.tag()no-Used for substitution and grouping in reporting
idstr | NonenoNoneOptional stable identifier for this question
Example Code

Simple list with auto-generated sets:

car_brands = ["Ford", "Toyota", "Honda", "Tesla", "BMW", "Audi"]
s.max_diff_question(
    "Which of the following car brands do you prefer?",
    items=car_brands,
    labels=["Least", "Most"]
)

Chat version with label substitution:

s.max_diff_question(
    "Which of the following cars do you prefer the **{label}**?",
    items=["Ford", "Toyota", "Honda", "Tesla"],
    labels=["Least", "Most"]
)

Custom sets and tag substitution:

for brand in ["Ford", "Toyota"]:
    s.max_diff_question(
        f"Which of the following {brand} cars do you prefer?",
        items=[["Focus", "Fiesta", "Mustang"], ["Fusion", "Explorer", "Escape"]],
        labels=["Least", "Most"],
        s.tag(brand=brand)
    )
Notes
  • If items is a flat list, sets are generated automatically
  • For chat layouts, always include {label} in your question text
  • Responses are returned as a dictionary per set with selected values for each label
  • Use custom_validator for logic like ensuring diversity across sets or detecting straight-lining