Set-builder to interval notation converter
{ x | -1 < x ≤ 4 } becomes (-1, 4]: a parenthesis where the bound is left out, a square bracket where it is kept. The converter handles rays, bounded intervals and single values written with equality. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Set builder
- { x | -1 < x ≤ 4 }
- Variable
- x
- Interval
- (-1, 4]
- Lower
- -1
- Upper
- 4
Set-builder notation describes a number set by the property its members must satisfy, while interval notation packs the same idea into brackets and infinity symbols that graphing calculators, textbooks, and computer algebra systems all expect. Students who write { x | x greater than or equal to two } still need [2, ∞) on the answer sheet; teachers who auto-grade inequality units need a deterministic oracle that never swaps a square bracket for a parenthesis. This set-builder to interval notation converter accepts a simple one-variable description—one-sided rays, closed or open bounded segments, and singletons written with equality—and returns the matching interval string plus numeric lower and upper bounds with inclusivity flags.
What set-builder notation means and how intervals encode it
Set-builder notation writes a set as all values of a variable that pass a stated condition. The classic template is an opening brace, a variable, a vertical bar or colon read as such that, a predicate, and a closing brace. For real numbers the predicate is almost always a linear inequality or a short chain of inequalities: x greater than three, x less than or equal to zero, or zero less than or equal to x less than five.
Unbounded rays use the infinity symbol with a parenthesis on that side because infinity is never a number you can include. So { x | x greater than three } becomes the open ray (3, ∞), { x | x greater than or equal to two } becomes [2, ∞), and { x | zero less than or equal to x less than five } becomes [0, 5).
A singleton written { x | x equals four } is the degenerate closed interval [4, 4], which many courses also write as the set containing only four.
What you can enter and what you get
Paste a simple description such as { x | x > 3 }, {x | 0 ≤ x < 5 }, { y : y ≤ -1 }, or even the bare condition x >= 2 without braces. The parser normalizes unicode less-than-or-equal and greater-than-or-equal signs, optional membership phrasing like x in R on the left of the bar, and ordinary spaces.
Supported conditions are one-sided comparisons of the variable against a finite bound, the flipped form bound compared to the variable, compound chains bound op variable op bound, and equality for a singleton. Numbers may be integers, decimals, or scientific notation within a safe magnitude cap.
Where converting set-builder notation helps
Algebra classrooms and tutoring platforms use a set-builder to interval notation converter so learners can check bracket choices without waiting for office hours. Learning-management plugins need a deterministic oracle that marks [2, 5) correct and (2, 5] wrong for the same verbal description, which only works if inclusivity flags are first-class fields rather than fragile string guesses. Curriculum authors who translate word problems into set-builder form can batch-convert answer keys into interval form for answer sheets and graphing calculator drills.
Keep requests under a few hundred characters, pin the interval and inclusivity fields in tests, and you get reproducible notation for homework, LMS graders, and edge workers without standing up symbolic math infrastructure of your own.
What you can do with it
Homework and classroom checks
Students paste { x | condition } and verify the interval brackets and infinity sides against textbook answer keys.
Answer-key generation at scale
Curriculum tools convert banks of set-builder stems into interval notation for worksheets and calculator drills.
FAQ
Which set-builder forms are supported?
One-sided rays (x > a, x ≤ b), compound chains (a < x ≤ b), equality singletons (x = c), optional braces, | or : separators, and unicode ≤ ≥. Unions and ≠ are rejected as not a single interval.
What do square brackets and parentheses mean?
Infinity always uses a parenthesis because ±∞ is not a real number you can include.
Why was my ≠ condition rejected?
x ≠ a describes two rays, a union, not one connected interval. This converter returns a single interval only; build unions in a separate step if you need them.
How is a single value written in interval notation?
A condition of equality, such as x equal to 4, becomes the closed interval [4, 4]. It is a degenerate interval that contains only that one number, and many courses also write it as a set with a single element.
Why does infinity always take a parenthesis?
Because infinity is not a number that can be included in a set. So { x | x ≥ 2 } becomes [2, ∞): the bracket keeps 2, while the parenthesis on the infinite side shows the ray never ends.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/algebra/set-builder-to-interval \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"set_builder":"{ x | -1 < x ≤ 4 }"}'const res = await fetch("https://api.kit.forhosting.com/algebra/set-builder-to-interval", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"set_builder": "{ x | -1 < x ≤ 4 }"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/set-builder-to-interval",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"set_builder": "{ x | -1 < x ≤ 4 }"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/set-builder-to-interval", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"set_builder":"{ x | -1 < x ≤ 4 }"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"set_builder":"{ x | -1 < x ≤ 4 }"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/set-builder-to-interval", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"set_builder": "{ x | -1 < x ≤ 4 }"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.set_builder_to_interval",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What set-builder notation means and how intervals encode it
Interval notation replaces that prose with a compact pair of endpoints. A square bracket means the endpoint is included; a parenthesis means it is excluded. This capability focuses on connected sets—one interval—so conditions that would force a union, such as not-equal, are rejected with a clear invalid_input message instead of a silent wrong single interval. That design matches classroom language: first master the one-piece answer, then learn unions as a separate skill.
Input contract, supported forms, and response fields
POST a JSON body with one required string field set_builder (aliases expression, set, notation, and input are accepted). On success the body echoes a tidy set_builder string, the variable name, the interval string with −∞ or ∞ when needed, numeric lower and upper (null means unbounded on that side), lower_inclusive and upper_inclusive booleans, a kind label such as bounded, left_unbounded, right_unbounded, or singleton, and a short formula reminder of the bracket rules. Empty descriptions, unbalanced braces, variable mismatches, not-equal predicates, and empty resulting sets fail with invalid_input and are not billed. Example: set_builder equal to { x | -1 < x ≤ 4 } yields interval (-1, 4], lower -1 exclusive, upper 4 inclusive, kind bounded.
Where a set-builder to interval API earns its keep
Exam-prep generators produce hundreds of { x | a ⊙ x ⊙ b } stems and must emit the official interval key for each; calling a tiny parse API avoids shipping a full computer-algebra dependency for a one-variable inequality.
Integration use cases
LMS and exam auto-grading
Score set-builder items with a deterministic oracle that compares interval strings and inclusive endpoint flags.
Technical questions
How do I convert set-builder notation to interval notation?
Send set_builder such as { x | x > 3 } or { x | 0 ≤ x < 5 }. The API returns the interval string (for example (3, ∞) or [0, 5)) plus lower, upper, and inclusivity flags.
What does the set-builder to interval converter cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.