It's the remainder operator and is used to get the remainder after integer division. Lots of languages have it. For example:
10 % 3 // = 1 ; because 3 * 3 gets you 9, and 10 - 9 is 1.
Apparently it is not the same as the modulo operator entirely.
Answer from MarioDS on Stack OverflowMDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › Remainder
Remainder (%) - JavaScript | MDN
In JavaScript, the modulo operation (which doesn't have a dedicated operator) is used to normalize the second operand of bitwise shift operators (<<, >>, etc.), making the offset always a positive value.
Reddit
reddit.com › r/programming › understanding the javascript modulo operator
r/programming on Reddit: Understanding the JavaScript Modulo Operator
December 12, 2023 - The post explains the Modulo operator (%) in JavaScript, which is often misunderstood and appears to produce random values. The author clarifies its function by redefining how we think about division, emphasizing that it's about dividing a number into equally-sized groups without fractional remainders.
char - How can I use modulo operator (%) in JavaScript? - Stack Overflow
How can I use modulo operator (%) in calculation of numbers for JavaScript projects? More on stackoverflow.com
How to Use Modulo Operator (%) in JavaScript - TestMu AI Community
How can I use the modulo operator (%) in JavaScript? How can I apply the javascript modulo operator in calculations for my JavaScript projects? More on community.testmu.ai
Difference between modulo operator and remainder
Hi! this is my first post here and I hope someone can help me. Could anyone please explain to me, what’s the difference between remainder (%) and the modulo operator please? More on forum.freecodecamp.org
Understanding the JavaScript Modulo Operator
A quick peek at the documentation would reveal that % in JavaScript is not modulo, it's the remainder operator (or can be found in the ECMAScript specification ). This is confusing to many people, and unfortunately articles like these don't help by using the wrong terminology. The difference occurs when one of the values is negative. -21 % 4 The result of this is 3 for "mod" and -1 for "rem". This can be confusing behavior, if for example, to implement an isOdd function, you might think of something like this: function isOdd(n) { return n % 2 === 1 } However, this is wrong! It returns false for an input of -1. More on reddit.com
Videos
01:00
Master the Modulo Operator in JavaScript with Real-World Examples ...
02:23
You'll Use This More Than You Think... JavaScript Modulo Operator ...
04:45
Javascript Modulo Operator Explained | Understanding modulo rest ...
04:45
Modulo Operation in JavaScript - Coderbyte - YouTube
05:23
The Remainder Operator in JavaScript | Modulo % - YouTube
17:28
Guest Tutorial #6: The Modulo Operator with Golan Levin - YouTube
W3Schools
w3schools.com › js › js_arithmetic.asp
JavaScript Arithmetic
The modulus operator (%) returns the division remainder. let x = 5; let y = 2; let z = x % y; Try it Yourself » · In arithmetic, the division of two integers produces a quotient and a remainder. In mathematics, the result of a modulo operation is the remainder of an arithmetic division.
Mimo
mimo.org › glossary › javascript › modulo-operator
JavaScript Modulo Operator: Syntax, Usage, and Examples
The JavaScript modulo operator is a mathematical operator used to return the remainder after division of one number by another. It is one of the core arithmetic operators in JavaScript, yet it’s often misunderstood—particularly when working with negative numbers or in more advanced programming ...
Wikipedia
en.wikipedia.org › wiki › Modulo
Modulo - Wikipedia
1 week ago - But in a language where modulo has the sign of the dividend, that is incorrect, because when n (the dividend) is negative and odd, n mod 2 returns −1, and the function returns false. One correct alternative is to test that the remainder is not 0 (because remainder 0 is the same regardless of the signs): ... Modulo operations might be implemented such that a division with a remainder is calculated each time.
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-remainder-operator
JavaScript Remainder(%) Operator - GeeksforGeeks
July 23, 2025 - Modulo and Remainder work differently when the sign of both operands is different. In JavaScript remainder takes the sign of the dividend and to get modulo ((a % n) + n) % n should be used instead of a % n.
Quora
quora.com › What-is-the-reason-for-the-absence-of-a-modulo-operator-in-JavaScript-What-is-the-alternative-for-it
What is the reason for the absence of a modulo operator in JavaScript? What is the alternative for it? - Quora
Answer (1 of 2): Only the designers and inventors of JavaScript can speak to exactly why they didn’t include a modulo operator. I can make an educated guess. JavaScript was designed to be very similar to other popular programming languages like c and Java. Having a remainder operator(%) but not a...
Educative
educative.io › answers › what-is-the-modulo-operator-in-javascript
What is the modulo operator in JavaScript?
The modulo operator is represented by the % character in JavaScript.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators
Expressions and operators - JavaScript | MDN
Strict inequality operator. Operations to shift all bits of the operand. ... Bitwise left shift operator. ... Bitwise right shift operator. ... Bitwise unsigned right shift operator. Bitwise operators treat their operands as a set of 32 bits (zeros and ones) and return standard JavaScript numerical values.
2ality
2ality.com › 2019 › 08 › remainder-vs-modulo.html
Remainder operator vs. modulo operator (with JavaScript code)
For example, x mod 2**8 is used ... assert.equal(tarr[0], 1); Which of rem and mod is supported and how depends on the programming language: JavaScript‘s % operator is a remainder operator....