Onto Function
2026-02-28 17:56 Diff

367 Learners

Last updated on December 10, 2025

An onto function is a type of mapping where each element in the codomain set has a corresponding element in the domain set. In this article, we will discuss onto functions, its properties, composition, and how to represent it.

What is an Onto Function?

What Is Algebra? 🧮 | Simple Explanation with 🎯 Cool Examples for Kids | ✨BrightCHAMPS Math

Functions represent relationships between two sets. A function f: A → B is said to be onto if every element in the codomain B is the image of at least one element in the domain.

Difference Between Onto and Into Function

Functions can be classified as onto or into based on how the elements of the domain are mapped to elements in the codomain. With the help of the table below, let’s look at the differences between the functions.

Onto Function Into Function

A function is onto if every element in the co-domain is mapped to at least one element in the domain
 

In an into function, at least one element in the co-domain is not mapped by any element in the domain.

It is represented using the symbol

It is represented using the symbol ↣
 

For example, let f: {1, 2, 3, 4} → {w, x, y, z}, where: f(1) = w, f(2) = x, f(3) = y, f(4) = z. Here, every element in the codomain is mapped to the function, so this is an onto function.
 

For example, let f:{1, 2, 3} → {w, x, y, z}, where: f(1) = w, f(2) = x, f(3) = y. Here, the element z is not mapped with f, so it is an into function.
 

Number of Onto Functions Formula

To calculate the number of onto functions from set A to set B, assume that set A has n elements and set B has m elements. 
Let: 
|A| = n
|B| = m
 

The number of onto functions from A to B can be calculated using the formula:

Number of onto functions = total number of functions - number of functions that are not onto

The total number of functions from A to B = \(m^n\)

The number of onto functions =  
\(m^n - \binom{m}{1}(m-1)^n + \binom{m}{2}(m-2)^n - \dots + (-1)^m \binom{m}{m-1} 1^n \)

If n < m, there are no onto functions.

If n = m, then the number of onto functions is m! 

Explore Our Programs

What are the Properties of Onto Function?

A function is called onto if every element of the codomain is mapped to at least one element from the domain. The onto function follows certain properties; by understanding these properties, we can identify the functions. 

  • In an onto function, each element of the codomain is associated with at least one element from the domain; that is, no element in the codomain remains unmapped.
  • If a function has a right inverse, then it must be onto.
  • In an onto function, the range and co-domain are equal.
  • Not all onto functions are one-to-one. 

Composition of Onto Function

The composition of a function in mathematics is an operation that combines two functions to create a new function. If any two functions are onto functions, then their composition is also onto. For example, if \(f: A → B\) and \(g: B → C\) are both onto, then their composition \(g∘fg \circ f: A → C\) is also onto.

This is because every element in C is mapped to B through the function g, and every element in B is mapped to A through the function f. So, composition \((g∘fg \circ f)\) has element C mapped to A. 

How to Represent Onto Function Graphically?

Representing a function on a graph is the easiest way to compare the range with the co-domain. So, to verify whether the function is onto, we use a graph. A function is onto if every horizontal line intersects the graph at least once. This indicates that every value in the codomain is mapped to at least one element in the domain. 

Relationship Between Onto Function and One-to-One Function

Understanding one-to-one and onto functions is important when learning about inverse functions. A one-to-one function is also known as an injective function, and an onto function is also known as a surjective function. The main difference between these functions is that every co-domain is mapped with at least one domain, whereas in a one-to-one function, each element in the co-domain is mapped to a unique element in the domain.

If a function is both onto and one-to-one is called bijective. It means that each element in the domain is mapped to a unique element in the codomain. Each element in the codomain set is the image of some element from the domain set.

Tips and Tricks to Master Onto Function

Onto functions ensure that every element in the codomain is covered by at least one element from the domain. Practicing examples and visualizing mappings helps in mastering the concept.

  • Always check that every element in the codomain has at least one pre-image in the domain.
     
  • Use diagrams or mappings to visualize how each element of the domain connects to the codomain.
     
  • Compare onto with into functions to clearly identify differences and avoid confusion.
     
  • Practice with real-life examples like seat allocation, resource distribution, and cryptography to strengthen understanding.
     
  • Solve varied problems involving different types of functions to quickly recognize whether a function is onto.

Common Mistakes and How to Avoid Them in Onto Function

Students often confuse different types of functions because of their similarities. This confusion can lead to mistakes. Here are common mistakes students made with the onto function and how to avoid them. 

Real-World Applications of Onto Function

An onto function is one in which every element of the co-domain is the image of at least one element from the domain. In real life, we use the onto function in different fields like science, technology, cryptography, etc. Let’s learn them in detail. 
 

  • To schedule events, assign tasks, or resources, we use the onto function to ensure every need is met. For example, in schools to allocate seats to students we can use onto function where students (domain) and the seats(co-domain), so that each seat is assigned at least one student.
     
  • In cryptography, a cryptographic system may use a function that maps messages to encrypted code so that every possible encrypted output is generated.
  •  In economics, we use onto function to model the distribution of resources to demand, to ensure it reaches all. 
  • Using an onto function ensures every seat, task, or resource is assigned at least once, such as allocating seats to students in a classroom.
  • Onto functions are used to map messages to encrypted codes so that every possible encrypted output is generated.

Download Worksheets

Problem 1

Verify whether the function is onto or not. Let f: R → R be defined as f(x) = 2x + 3.

Okay, lets begin

The function f is onto 

Explanation

The function f: R → R is defined by \(f(x) = 2x + 3\). 

Where x and y are real numbers. Assume f(x) = y then, 

\(2x + 3 = y\)

\(x = \frac{(y - 3)}{2}\)

As x ∈ R for every y ∈ R in \(x = \frac{(y -3)}{2} \)

So, f is an onto function

Well explained 👍

Problem 2

Check if g is an onto function from C → D, where C = {1, 2, 3} and D = {4, 5}, and let g = {(1, 4), (2, 5), (3, 5)}

Okay, lets begin

The function g is onto

Explanation

Given, 

C = {1, 2, 3}

D = {4, 5}

g = {(1, 4), (2, 5), (3, 5)}

Here, all the elements in set D are mapped with g; the function g is an onto function.

Well explained 👍

Problem 3

Let f: R → R, f(x) = 2x and g: R → R, g(x) = x + 1. Is g∘f onto?

Okay, lets begin

The function\( g∘f\) is onto.

Explanation

Given,

\(f: R → R, f(x) = 2x\)

  \(g: R → R, g(x) = x + 1\)

So, \((g∘f)(x)=g(f(x))=g(2x)=2x+1(g \circ f)(x) = g(f(x)) = g(2x) = 2x + 1\)

A function is said to be onto when each element of the co-domain is mapped to at least one element from the domain. 

Checking if x ∈ R in \(g∘f(x) = y\)

That is, \(2x + 1 = y\)

\(2x = y - 1\)

\(x =\frac{ (y - 1)}{2}\)

So, the function \(g∘f\) is an onto function

Well explained 👍

Problem 4

If f: R → R, f(x) = 5x - 7, is f onto?

Okay, lets begin

Yes, the function f is onto.

Explanation

For any y ∈ R, 

\(5x - 7 = y\)

\(5x = y - 7\)

\(x = \frac{(y - 7)}{5}\)

Therefore, every real y is associated with x, such that f(x) = y. So f is an onto function.

Well explained 👍

Problem 5

Consider the function h: {1, 2, 3, 4} → {5, 6, 7, 8} defined as follows: h(1) = 5, h(2) = 6, h(3) = 7, and h(4) = 8. Verify if the function is onto?

Okay, lets begin

The function h is onto

Explanation

Here, 

h: {1, 2, 3, 4} → {5, 6, 7, 8} 

D = {5, 6, 7, 8}

Where, h(1) = 5

h(2) = 6

h(3) = 7

h(4) = 8

The function is onto, as all the elements in D are mapped by h

Well explained 👍

FAQs on Onto Function

1.What is an onto function?

A function is onto if every element of the co-domain is associated with the domain.

2.How to check if a function is onto?

To check whether a function is onto, start by writing the equation f(x) = y, where y is an arbitrary element of the co-domain B. 
Solve for x in terms of y, and then check whether the resulting x lies within the domain. If this is true for every y ∈ B, the function is onto.

3.Can a function be onto and one-to-one?

Yes, the functions can be both onto and one-to-one. Such functions are known as bijections.

4.What is an into function?

An into function is a type of function in which at least one element in the co-domain is not mapped to the domain. 

5.What is the relationship between range and co-domain in an onto function?

In an onto function, the range is equal to the co-domain. That is, every element in the codomain is mapped by at least one element in the domain.

6.How can I help my child understand onto functions?

Use real-life examples like assigning every seat to a student, distributing resources, or mapping messages to encrypted codes to show that all outputs are covered.

7.What are common mistakes children make with onto functions?

Children often confuse onto with into functions or forget to check if every element of the codomain has a pre-image.

8.At what stage do children typically learn onto functions?

Students are usually introduced to onto (and into) functions in middle or high school, around ages 12–15, depending on the curriculum.

Jaskaran Singh Saluja

About the Author

Jaskaran Singh Saluja is a math wizard with nearly three years of experience as a math teacher. His expertise is in algebra, so he can make algebra classes interesting by turning tricky equations into simple puzzles.

Fun Fact

: He loves to play the quiz with kids through algebra to make kids love it.