🧮
🧮 Math & statistics

Set Builder Notation Calculator (set-builder ↔ roster form)

Results update as you type.

Your numbers

Understanding the set-builder notation calculator — concept and principle

This calculator converts between set-builder notation and roster form. Choose the kind of number, the bounds and an extra condition to list the elements and count them, or enter a list to get a set-builder rule. Use it for discrete maths, algebra and set theory homework.

Set-builder notation to roster form{x ∈ ℤ | −3 ≤ x < 12, x even}−3−2−10123456789101112includednot{−2, 0, 2, 4, 6, 8, 10}n(A)7
Keep the integers from −3 up to (not including) 12 that are even: seven elements.

How it is calculated

An empty result is the empty set ∅. Rosters longer than 30 elements are shortened with "…".

The principle

A set can be described by listing its elements (roster method) or by stating the rule its elements satisfy (set-builder notation). {x ∈ ℤ | condition} is read "the set of all integers x such that the condition holds"; the bar means "such that". Set-builder notation is essential for large or infinite sets, where listing is impossible. Interval notation describes the bounds for real numbers: [−3, 12) includes −3 but not 12. The number of elements, n(A), is the cardinality of the set.

Worked example

Default inputs: integers, −3 ≤ x < 12, x is even.

  1. Integers from −3 up to but not including 12: −3, −2, …, 11.
  2. Keep the even ones: −2, 0, 2, 4, 6, 8, 10.
  3. Roster: {−2, 0, 2, 4, 6, 8, 10}, with n(A) = 7.
  4. Set-builder: {x ∈ ℤ | −3 ≤ x < 12, x is even}.
  5. Smallest −2, largest 10; the bound interval in real numbers is [−3, 12).
How Number of elements n(A) changes with Upper boundHow Number of elements n changes with Up…246810121436912151824Example: 7Upper bound
Each point is the calculator re-run with only “Upper bound” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Upper boundNumber of elements n(A)
33
64
96
127
159
1810
2413

How to read the result

n(A) tells you how many elements meet the rule. The smallest and largest elements show whether the bounds behaved as expected, especially whether an endpoint was included. In the reverse direction, a found pattern such as x = 4n − 1 gives a compact rule; if no constant difference exists, the set is described by listing it.

Common mistakes

Keep in mind: Conventions differ: some textbooks write ℕ to include 0, and some use a colon instead of a bar. Follow the notation your course uses.

Frequently asked questions

What does the vertical bar mean in set-builder notation?

"Such that". {x | x > 2} is the set of all x such that x > 2.

Is 0 a natural number?

It depends on the convention. This calculator uses ℕ = {1, 2, 3, …} and ℕ₀ when 0 is included.

How do I write the empty set?

∅ or { }, a set with no elements.

Sources: OpenStax, Contemporary Mathematics (2023), §1.1 Basic Set Concepts

Checked 9 Nov 2026. OpenStax, Contemporary Mathematics (2023), §1.1 Basic Set Concepts (roster method, set-builder notation, cardinality of a set, natural numbers, integers, empty set).

🧮 All math & statistics tools →🌍 Calculators by country →