Supported functions include arithmetic, powers, sqrt(), log(), ln(), exp(), abs(), sin(), cos(), tan(), and constants pi/e.
Domain and Range Calculator
Use this Domain and Range Calculator to enter values, adjust options, and review results in a compact responsive workspace.
Results are calculated automatically as you enter data.
▼ See explanations and tips below ▼
Related Calculators
What Are Domain and Range?
The domain of a function is the set of input values that the function can accept. For a function written as \(f(x)\), the domain answers the question: which real values of \(x\) are allowed?
The range of a function is the set of output values the function can produce. It answers the question: after using all allowed inputs, which real values can \(f(x)\) take?
For example, the function \(f(x)=x^2\) accepts every real number as an input, so its domain is all real numbers. Its outputs, however, are never negative, so its range is \([0,\infty)\).
Domain and range are usually written in one of three common ways:
- Words: all real numbers except \(2\).
- Interval notation: \((-\infty,2)\cup(2,\infty)\).
- Set-builder notation: \(\{x\in\mathbb{R}\mid x\ne2\}\).
These formats describe the same idea from different angles. Interval notation is compact, while set-builder notation is useful when a rule or condition is clearer than a list of intervals.
Why Domain and Range Matter
Domain and range help you understand what a function actually means. A formula may look valid at first glance, but some inputs can make the expression undefined or non-real. For example, division by zero is not allowed in real-number algebra, and a square root of a negative number is not a real number.
Domain and range also matter when graphing. The domain tells you how far the graph extends left and right. The range tells you how far the graph extends down and up. When a graph has a break, hole, endpoint, or vertical asymptote, the domain and range often explain why.
In algebra and precalculus, domain and range are especially useful for:
- checking whether a formula is valid for a given input;
- describing graph behavior clearly;
- recognizing restrictions caused by fractions, radicals, logarithms, and trigonometric functions;
- comparing a numerical graph preview with the exact mathematical behavior of a function.
Key Terms to Know
- Function: A rule that assigns each allowed input exactly one output.
- Input: The value substituted for \(x\).
- Output: The value produced by the function, usually written as \(f(x)\).
- Domain: The set of all allowed inputs.
- Range: The set of all possible outputs.
- Real-valued function: A function whose outputs are real numbers.
- Interval notation: A compact way to describe continuous sets of real numbers, such as \([1,5)\) or \((-\infty,3)\).
- Set-builder notation: A way to describe a set using a condition, such as \(\{x\in\mathbb{R}\mid x>0\}\).
- Restriction: A condition that removes some inputs from the domain.
- Discontinuity: A break, hole, jump, or asymptote in a graph.
- Vertical asymptote: A vertical line that a graph approaches but does not cross in the usual function behavior.
- Numerical sampling: Estimating behavior by evaluating a function at many selected input values.
How Domain and Range Work
A good first step is to imagine that every real number is allowed, then remove inputs that break the rules of real-number functions.
Common domain restrictions include these conditions:
Denominators cannot equal zero
For a fraction with denominator \(g(x)\), the denominator must not be zero:
For example, in
the denominator is zero when \(x=2\), so \(2\) must be excluded from the domain.
Even roots need nonnegative radicands
For a square root, the expression inside the root must be greater than or equal to zero:
For example,
requires \(x+4\ge0\), so \(x\ge-4\).
Logarithms need positive arguments
For a logarithm, the argument must be positive:
For example,
requires \(x-1>0\), so \(x>1\).
Tangent has repeating excluded inputs
The tangent function is undefined where its cosine denominator is zero. For a tangent expression, excluded inputs occur when the tangent argument equals
where \(k\) is any integer. For the parent function \(f(x)=\tan(x)\), the excluded inputs are
Range is often harder than domain
The domain is often found by solving restrictions on the input. The range is usually more subtle because it depends on the output behavior of the whole function. A graph can help, but a graph window only shows part of the function.
To prove an exact range, you may need algebra, inverse functions, graph transformations, or optimization. A numerical range preview is useful for exploration, but it should not be treated as a proof of the global range unless the function and window make that conclusion justified.
A graph-window range estimate is based on sampled outputs. If a function is sampled from \(x_{\min}\) to \(x_{\max}\) using a chosen number of sample intervals, the step size is
The sampled inputs are
The sampled output envelope is then based on the smallest and largest finite values found among those sampled outputs:
This envelope is an estimate inside the selected graph window. It does not prove that every value between the endpoints occurs, and it is not necessarily the exact range over the full domain. When the calculator can prove an exact global range for a supported family, it displays that result separately.
Examples of Domain and Range in Practice
Example 1: A rational function
Consider
The denominator cannot be zero:
Solving gives
So the domain is
In set-builder notation, this is
The graph has a vertical asymptote at \(x=3\), so a graph preview should not draw one continuous curve through that excluded value.
Example 2: A square-root function
Consider
The value under the square root must be nonnegative:
Solving gives
So the domain is
Because square roots produce nonnegative outputs, the range is
This example shows why endpoints matter. The input \(x=-4\) is allowed because it gives \(\sqrt{0}=0\), so the interval uses a square bracket.
Example 3: A logarithmic function
Consider
The logarithm argument must be positive:
Solving gives
So the domain is
The endpoint \(x=1\) is not included because the logarithm of zero is undefined. The graph has a vertical asymptote at \(x=1\) and continues to the right.
Example 4: A tangent function
Consider
The tangent function is undefined at
So the domain is all real numbers except those repeating values:
Its graph has repeating vertical asymptotes, and a limited graph window may show only some of them.
How to Interpret the Result
A domain result tells you which real values of \(x\) are allowed for the entered function.
If the domain is shown as all real numbers, it means no supported restriction was detected. In mathematical notation, all real numbers may be written as
or
If the domain excludes one or more values, those values make the expression undefined or invalid over the real numbers. A rational function may exclude denominator roots, while a tangent function may exclude infinitely many repeating values.
If the result says the domain needs review, it means restrictions were detected but exact interval or periodic notation may require additional algebra. This can happen with square roots, logarithms, tangent expressions, or denominator restrictions that are not simple enough to solve automatically.
The range preview should be read as an estimate from the chosen graph window. A result such as
means the finite sampled outputs in the selected window ranged from about \(-2.5\) to about \(8.1\). A different window or higher sample density may reveal a different minimum or maximum.
The restrictions table, when shown, explains where restrictions came from. The graph preview can also mark detected excluded \(x\)-values when they fall inside the selected window.
Common Mistakes and Misconceptions
Assuming the range preview is exact. A sampled graph can miss a sharp turning point, a narrow feature, or behavior outside the selected window. Treat the preview as a guide, not a proof.
Forgetting denominator restrictions. In a rational function, values that make the denominator zero must be excluded even if the numerator is also zero.
Treating square-root endpoints incorrectly. For \(\sqrt{a(x)}\), the condition is \(a(x)\ge0\), not \(a(x)>0\). A zero radicand is allowed.
Treating logarithm endpoints incorrectly. For \(\ln(a(x))\) or \(\log(a(x))\), the condition is \(a(x)>0\). A zero or negative argument is not allowed in real-valued logarithms.
Using commas as decimals. Decimal inputs should use a decimal point. Commas are not interpreted as decimal separators.
Using a variable other than \(x\). The calculator is designed for functions of a single variable \(x\).
Expecting every function form to be supported. Some functions, piecewise definitions, multi-argument functions, and inverse trigonometric functions may require separate algebra or another tool.
Forgetting that \(\log\) and \(\ln\) are handled the same way here. In this calculator, both are evaluated as natural logarithms. That affects numerical outputs, although the domain condition is still the same: the argument must be positive.
When to Use Domain and Range
Use domain and range when you need to understand where a function is valid and what outputs it can produce.
Common use cases include:
- checking homework answers in algebra, precalculus, and graphing units;
- finding restrictions before graphing a function;
- comparing interval notation and set-builder notation;
- identifying holes, excluded values, and vertical asymptotes;
- exploring how graph windows affect visible behavior;
- estimating output ranges before doing a more exact symbolic analysis.
Domain and range are also useful when modeling real situations. A formula may be mathematically valid for many inputs, but a real-world model may require a smaller domain. For example, time may need to be nonnegative, a quantity may need to be whole-numbered, or a physical measurement may need to stay within a meaningful interval.
Limitations and Things to Keep in Mind
This calculator works with real-valued functions of a single variable \(x\). It does not analyze complex-valued domains or functions of multiple variables.
The domain analyzer exactly handles constant, linear, and quadratic polynomial restrictions, supported rational inequalities, affine square roots and logarithms, affine tangent exclusions, and supported integer or rational powers. If any domain-sensitive expression falls outside that symbolic subset, the result is labeled partial and shows only conditions that were proved.
Exact global ranges are proved for supported common families such as affine and quadratic functions, affine transformations of standard elementary functions, and linear-fractional functions. Otherwise, the calculator shows a sampled output envelope from the selected graph window. That envelope depends on three choices:
- the left endpoint \(x_{\min}\);
- the right endpoint \(x_{\max}\);
- the sample density.
A narrow graph window may miss important behavior. A low sample density may miss extrema between sampled points. A wider window or higher sample density can improve exploration, but it still does not replace exact algebra when an exact global range is required.
Every finite sampled output, including very large values, participates in the sampled envelope. Non-finite and invalid points are separated from valid graph segments. Graph scaling may visually compress extreme behavior near vertical asymptotes, so inspect the exact domain and numerical labels as well as the curve.
Displayed numbers may be rounded. Range preview values are shown to a practical decimal precision, while graph hover values and detected boundaries may use different display precision. Rounding makes results easier to read, but exact symbolic work may require keeping expressions in exact form.
How to Use This Calculator
- Enter a real-valued function using \(x\) as the variable.
-
Use supported operations and functions such as
sqrt,log,ln,exp,abs,sin,cos, andtan. - Set the graph x-min and x-max values to choose the window used for the graph and range preview, with x-min less than x-max.
- Enter a whole-number sample density from \(120\) to \(1200\).
- Turn on the restrictions table if you want a detailed breakdown of detected restrictions.
- Review the domain, set notation, exact range when available, sampled output envelope, restrictions, graph, and steps.
- Move over the graph to inspect finite coordinate values when available.
- Download the graph image if the graph is available and the download option is shown.
For best results, start with a graph window that covers the behavior you care about. If the range preview looks surprising, try a wider window, a more focused window near important features, or a higher sample density.
Frequently Asked Questions
What is the difference between domain and range?
The domain is the set of allowed inputs. The range is the set of possible outputs. For \(f(x)=x^2\), the domain is all real numbers, but the range is only nonnegative values.
Why does a function sometimes have a domain restriction?
A restriction appears when some input would make the expression undefined or non-real. Common causes include division by zero, square roots of negative numbers, logarithms of nonpositive numbers, and tangent asymptotes.
Is the sampled output envelope the exact range?
No. The sampled output envelope is based on finite outputs in the selected graph window and may include values that the function never attains. When the calculator proves an exact global range, it displays that result in a separate card.
Why might the domain say review is needed?
Some restrictions are easy to state but harder to solve completely. Square-root inequalities, logarithmic inequalities, tangent exclusions, and complicated denominator expressions can require additional symbolic work beyond an automatic preview.
Why is \(x=0\) allowed in some functions but not others?
Whether \(0\) is allowed depends on what the expression does with it. In \(f(x)=x^2\), \(0\) is allowed. In \(f(x)=\frac{1}{x}\), \(0\) is not allowed because it creates division by zero. In \(f(x)=\ln(x)\), \(0\) is not allowed because logarithm arguments must be positive.
How should I choose the graph window?
Choose a window that includes the part of the function you want to study. If you are checking behavior near a restriction, include values on both sides when possible. If you are estimating range, remember that changing the window can change the previewed minimum and maximum.
Can a function have an empty domain?
Yes. A formula can be undefined for every real input. For example, a denominator that is always zero would leave no real input values available.
Sources and References
Books
- Jay Abramson. College Algebra 2e. OpenStax, 2021. Chapter 3, Sections 3.1 “Functions and Function Notation” and 3.2 “Domain and Range.” Accessed June 28, 2026. Section 3.1, Section 3.2.
- Jay Abramson. Precalculus 2e. OpenStax, 2021. Sections 1.2 “Domain and Range,” 4.4 “Graphs of Logarithmic Functions,” and 6.2 “Graphs of the Other Trigonometric Functions.” Accessed June 28, 2026. Section 1.2, Section 4.4, Section 6.2.