Step 1: Definition of a binary operation.
A binary operation on set \(S\) is a function:
\[
*: S\times S \rightarrow S
\]
Step 2: Count elements in domain.
If \(|S|=n\), then:
\[
|S\times S| = n^2
\]
So there are \(n^2\) ordered pairs. Step 3: Count number of functions.
For each of the \(n^2\) ordered pairs, the output can be any of the \(n\) elements of \(S\).
So total number of functions is:
\[
n^{n^2}
\]
Final Answer:
\[
\boxed{n^{n^2}}
\]